function(e) {
	var t = {};

	function n(s) {
		if (t[s]) return t[s].exports;
		var r = t[s] = {
			i: s,
			l: !1,
			exports: {}
		};
		return e[s].call(r.exports, r, r.exports, n), r.l = !0, r.exports
	}
	return n.m = e, n.c = t, n.d = function(e, t, s) {
		n.o(e, t) || Object.defineProperty(e, t, {
			enumerable: !0,
			get: s
		})
	}, n.r = function(e) {
		"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
			value: "Module"
		}), Object.defineProperty(e, "__esModule", {
			value: !0
		})
	}, n.t = function(e, t) {
		if (1 & t && (e = n(e)), 8 & t) return e;
		if (4 & t && "object" == typeof e && e && e.__esModule) return e;
		var s = Object.create(null);
		if (n.r(s), Object.defineProperty(s, "default", {
				enumerable: !0,
				value: e
			}), 2 & t && "string" != typeof e)
			for (var r in e) n.d(s, r, function(t) {
				return e[t]
			}.bind(null, r));
		return s
	}, n.n = function(e) {
		var t = e && e.__esModule ? function() {
			return e.default
		} : function() {
			return e
		};
		return n.d(t, "a", t), t
	}, n.o = function(e, t) {
		return Object.prototype.hasOwnProperty.call(e, t)
	}, n.p = "", n(n.s = 107)
}([function(e, t, n) {
	var s = n(39),
		r = n(40);

	function i(e) {
		"object" == typeof e ? (this.callFunc = e.callFunc || null, this.message = e.message ||
			"UNKNOW ERROR") : this.message = e, this.time = new Date, this.timetag = +this.time
	}
	n(58);
	var o, a, c = n(6),
		m = c.getGlobal(),
		u = /\s+/;
	c.deduplicate = function(e) {
		var t = [];
		return e.forEach((function(e) {
			-1 === t.indexOf(e) && t.push(e)
		})), t
	}, c.capFirstLetter = function(e) {
		return e ? (e = "" + e).slice(0, 1).toUpperCase() + e.slice(1) : ""
	}, c.guid = (o = function() {
		return (65536 * (1 + Math.random()) | 0).toString(16).substring(1)
	}, function() {
		return o() + o() + o() + o() + o() + o() + o() + o()
	}), c.extend = function(e, t, n) {
		for (var s in t) void 0 !== e[s] && !0 !== n || (e[s] = t[s])
	}, c.filterObj = function(e, t) {
		var n = {};
		return c.isString(t) && (t = t.split(u)), t.forEach((function(t) {
			e.hasOwnProperty(t) && (n[t] = e[t])
		})), n
	}, c.copy = function(e, t) {
		return t = t || {}, e ? (Object.keys(e).forEach((function(n) {
			c.exist(e[n]) && (t[n] = e[n])
		})), t) : t
	}, c.copyWithNull = function(e, t) {
		return t = t || {}, e ? (Object.keys(e).forEach((function(n) {
			(c.exist(e[n]) || c.isnull(e[n])) && (t[n] = e[n])
		})), t) : t
	}, c.findObjIndexInArray = function(e, t) {
		e = e || [];
		var n = t.keyPath || "id",
			s = -1;
		return e.some((function(e, i) {
			if (r(e, n) === t.value) return s = i, !0
		})), s
	}, c.findObjInArray = function(e, t) {
		var n = c.findObjIndexInArray(e, t);
		return -1 === n ? null : e[n]
	}, c.mergeObjArray = function() {
		var e = [],
			t = [].slice.call(arguments, 0, -1),
			n = arguments[arguments.length - 1];
		c.isArray(n) && (t.push(n), n = {});
		var s, i = n.keyPath = n.keyPath || "id";
		for (n.sortPath = n.sortPath || i; !e.length && t.length;) e = (e = t.shift() || []).slice(0);
		return t.forEach((function(t) {
			t && t.forEach((function(t) {
				-1 !== (s = c.findObjIndexInArray(e, {
					keyPath: i,
					value: r(t, i)
				})) ? e[s] = c.merge({}, e[s], t) : e.push(t)
			}))
		})), n.notSort || (e = c.sortObjArray(e, n)), e
	}, c.cutObjArray = function(e) {
		var t = e.slice(0),
			n = arguments.length,
			s = [].slice.call(arguments, 1, n - 1),
			i = arguments[n - 1];
		c.isObject(i) || (s.push(i), i = {});
		var o, a = i.keyPath = i.keyPath || "id";
		return s.forEach((function(e) {
			c.isArray(e) || (e = [e]), e.forEach((function(e) {
				e && (i.value = r(e, a), -1 !== (o = c.findObjIndexInArray(t,
					i)) && t.splice(o, 1))
			}))
		})), t
	}, c.sortObjArray = function(e, t) {
		var n = (t = t || {}).sortPath || "id";
		s.insensitive = !!t.insensitive;
		var i, o, a, m = !!t.desc;
		return a = c.isFunction(t.compare) ? t.compare : function(e, t) {
			return i = r(e, n), o = r(t, n), m ? s(o, i) : s(i, o)
		}, e.sort(a)
	}, c.emptyFunc = function() {}, c.isEmptyFunc = function(e) {
		return e === c.emptyFunc
	}, c.notEmptyFunc = function(e) {
		return e !== c.emptyFunc
	}, c.splice = function(e, t, n) {
		return [].splice.call(e, t, n)
	}, c.reshape2d = function(e, t) {
		if (Array.isArray(e)) {
			c.verifyParamType("type", t, "number", "util::reshape2d");
			let n = e.length;
			if (n <= t) return [e]; {
				let s = Math.ceil(n / t),
					r = [];
				for (let n = 0; n < s; n++) r.push(e.slice(n * t, (n + 1) * t));
				return r
			}
		}
		return e
	}, c.flatten2d = function(e) {
		if (Array.isArray(e)) {
			let t = [];
			return e.forEach(e => {
				t = t.concat(e)
			}), t
		}
		return e
	}, c.dropArrayDuplicates = function(e) {
		if (Array.isArray(e)) {
			let t = {},
				n = [];
			for (; e.length > 0;) {
				t[e.shift()] = !0
			}
			for (let e in t) !0 === t[e] && n.push(e);
			return n
		}
		return e
	}, c.onError = function(e) {
		throw new i(e)
	}, c.verifyParamPresent = function(e, t, n, s) {
		n = n || "";
		var r = !1;
		switch (c.typeOf(t)) {
			case "undefined":
			case "null":
				r = !0;
				break;
			case "string":
				"" === t && (r = !0);
				break;
			case "StrStrMap":
			case "object":
				Object.keys(t).length || (r = !0);
				break;
			case "array":
				t.length ? t.some((function(e) {
					if (c.notexist(e)) return r = !0, !0
				})) : r = !0
		}
		r && c.onParamAbsent(n + e, s)
	}, c.onParamAbsent = function(e, t) {
		c.onParamError(`缺少参数 ${e}, 请确保参数不是 空字符串、空对象、空数组、null或undefined, 或数组的内容不是 null/undefined`, t)
	}, c.verifyParamAbsent = function(e, t, n, s) {
		n = n || "", void 0 !== t && c.onParamPresent(n + e, s)
	}, c.onParamPresent = function(e, t) {
		c.onParamError("多余的参数 " + e, t)
	}, c.verifyParamType = function(e, t, n, s) {
		var r = c.typeOf(t).toLowerCase();
		c.isArray(n) || (n = [n]);
		var i = !0;
		switch (-1 === (n = n.map((function(e) {
			return e.toLowerCase()
		}))).indexOf(r) && (i = !1), r) {
			case "number":
				isNaN(t) && (i = !1);
				break;
			case "string":
				"numeric or numeric string" === n.join("") && (i = !!/^[0-9]+$/.test(t))
		}
		i || c.onParamInvalidType(e, n, "", s)
	}, c.onParamInvalidType = function(e, t, n, s) {
		n = n || "", t = c.isArray(t) ? (t = t.map((function(e) {
			return '"' + e + '"'
		}))).join(", ") : '"' + t + '"', c.onParamError('参数"' + n + e + '"类型错误, 合法的类型包括: [' + t +
			"]", s)
	}, c.verifyParamValid = function(e, t, n, s) {
		c.isArray(n) || (n = [n]), -1 === n.indexOf(t) && c.onParamInvalidValue(e, n, s)
	}, c.onParamInvalidValue = function(e, t, n) {
		c.isArray(t) || (t = [t]), t = t.map((function(e) {
			return '"' + e + '"'
		})), c.isArray(t) && (t = t.join(", ")), c.onParamError(
			`参数 ${e}值错误, 合法的值包括: [${JSON.stringify(t)}]`, n)
	}, c.verifyParamMin = function(e, t, n, s) {
		t < n && c.onParamError("参数" + e + "的值不能小于" + n, s)
	}, c.verifyParamMax = function(e, t, n, s) {
		t > n && c.onParamError("参数" + e + "的值不能大于" + n, s)
	}, c.verifyArrayMax = function(e, t, n, s) {
		t.length > n && c.onParamError("参数" + e + "的长度不能大于" + n, s)
	}, c.verifyEmail = (a = /^\S+@\S+$/, function(e, t, n) {
		a.test(t) || c.onParamError("参数" + e + "邮箱格式错误, 合法格式必须包含@符号, @符号前后至少要各有一个字符", n)
	}), c.verifyTel = function() {
		var e = /^[+\-()\d]+$/;
		return function(t, n, s) {
			e.test(n) || c.onParamError("参数" + t + "电话号码格式错误, 合法字符包括+、-、英文括号和数字", s)
		}
	}(), c.verifyBirth = function() {
		var e = /^(\d{4})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/;
		return function(t, n, s) {
			e.test(n) || c.onParamError("参数" + t + '生日格式错误, 合法为"yyyy-MM-dd"', s)
		}
	}(), c.onParamError = function(e, t) {
		c.onError({
			message: e,
			callFunc: t
		})
	}, c.verifyOptions = function(e, t, n, s, r) {
		if (e = e || {}, t && (c.isString(t) && (t = t.split(u)), c.isArray(t))) {
			"boolean" != typeof n && (r = n || null, n = !0, s = "");
			var i = n ? c.verifyParamPresent : c.verifyParamAbsent;
			t.forEach((function(t) {
				i.call(c, t, e[t], s, r)
			}))
		}
		return e
	}, c.verifyParamAtLeastPresentOne = function(e, t, n) {
		t && (c.isString(t) && (t = t.split(u)), c.isArray(t) && (t.some((function(t) {
			return c.exist(e[t])
		})) || c.onParamError("以下参数[" + t.join(", ") + "]至少需要传入一个", n)))
	}, c.verifyParamPresentJustOne = function(e, t, n) {
		t && (c.isString(t) && (t = t.split(u)), c.isArray(t) && 1 !== t.reduce((function(t, n) {
			return c.exist(e[n]) && t++, t
		}), 0) && c.onParamError("以下参数[" + t.join(", ") + "]必须且只能传入一个", n))
	}, c.verifyBooleanWithDefault = function(e, t, n, s, r) {
		c.undef(n) && (n = !0), u.test(t) && (t = t.split(u)), c.isArray(t) ? t.forEach((function(t) {
			c.verifyBooleanWithDefault(e, t, n, s, r)
		})) : void 0 === e[t] ? e[t] = n : c.isBoolean(e[t]) || c.onParamInvalidType(t, "boolean",
			s, r)
	}, c.verifyFileInput = function(e, t) {
		return c.verifyParamPresent("fileInput", e, "", t), c.isString(e) && ((e = "undefined" ==
				typeof document ? void 0 : document.getElementById(e)) || c.onParamError(
				"找不到要上传的文件对应的input, 请检查fileInput id " + e, t)), e.tagName && "input" === e.tagName
			.toLowerCase() && "file" === e.type.toLowerCase() || c.onParamError(
				`请提供正确的 fileInput, 必须为 file 类型的 input 节点 tagname:${e.tagName}, filetype:${e.type}`, t),
			e
	}, c.verifyFileType = function(e, t) {
		c.verifyParamValid("type", e, c.validFileTypes, t)
	}, c.verifyCallback = function(e, t, n) {
		u.test(t) && (t = t.split(u)), c.isArray(t) ? t.forEach((function(t) {
				c.verifyCallback(e, t, n)
			})) : e[t] ? c.isFunction(e[t]) || c.onParamInvalidType(t, "function", "", n) : e[t] = c
			.emptyFunc
	}, c.verifyFileUploadCallback = function(e, t) {
		c.verifyCallback(e, "uploadprogress uploaddone uploaderror uploadcancel", t)
	}, c.validFileTypes = ["image", "audio", "video", "file"], c.validFileExts = {
		image: ["bmp", "gif", "jpg", "jpeg", "jng", "png", "webp"],
		audio: ["mp3", "wav", "aac", "wma", "wmv", "amr", "mp2", "flac", "vorbis", "ac3"],
		video: ["mp4", "rm", "rmvb", "wmv", "avi", "mpg", "mpeg", "mov"]
	}, c.filterFiles = function(e, t) {
		var n, s, r = "file" === (t = t.toLowerCase()),
			i = [];
		return [].forEach.call(e, (function(e) {
			if (r) i.push(e);
			else if (n = e.name.slice(e.name.lastIndexOf(".") + 1), (s = e.type.split("/"))[
					0] && s[1]) {
				(s[0].toLowerCase() === t || -1 !== c.validFileExts[t].indexOf(n)) && i
					.push(e)
			}
		})), i
	};
	var l, d = c.supportFormData = c.notundef(m.FormData);
	c.getFileName = function(e) {
		return e = c.verifyFileInput(e), d ? e.files[0].name : e.value.slice(e.value.lastIndexOf("\\") +
			1)
	}, c.getFileInfo = function() {
		const e = {
			ppt: 1,
			pptx: 2,
			pdf: 3,
			doc: 6,
			docx: 7
		};
		return function(t) {
			const n = {};
			if (!(t = c.verifyFileInput(t)).files) return n;
			const s = t.files[0];
			return d && (n.name = s.name, n.size = s.size, n.type = s.name.match(/\.(\w+)$/), n
				.type = n.type && n.type[1].toLowerCase(), n.transcodeType = e[n.type] || 0), n
		}
	}(), c.sizeText = (l = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "BB"], function(e) {
		var t, n = 0;
		do {
			t = (e = Math.floor(100 * e) / 100) + l[n], e /= 1024, n++
		} while (e > 1);
		return t
	}), c.promises2cmds = function(e) {
		return e.map((function(e) {
			return e.cmd
		}))
	}, c.objs2accounts = function(e) {
		return e.map((function(e) {
			return e.account
		}))
	}, c.teams2ids = function(e) {
		return e.map((function(e) {
			return e.teamId
		}))
	}, c.objs2ids = function(e) {
		return e.map((function(e) {
			return e.id
		}))
	}, c.getMaxUpdateTime = function(e) {
		var t = e.map((function(e) {
			return +e.updateTime
		}));
		return Math.max.apply(Math, t)
	}, c.genCheckUniqueFunc = function(e, t) {
		return e = e || "id", t = t || 1e3,
			function(t) {
				this.uniqueSet = this.uniqueSet || {}, this.uniqueSet[e] = this.uniqueSet[e] || {};
				const n = this.uniqueSet[e],
					s = t[e];
				return !n[s] && (n[s] = !0, !0)
			}
	}, c.fillPropertyWithDefault = function(e, t, n) {
		return !!c.undef(e[t]) && (e[t] = n, !0)
	}, c.throttle = function(e, t, n, s) {
		var r, i, o = null,
			a = 0;
		n || (n = {});
		var c = function() {
			a = !1 === n.leading ? 0 : (new Date).getTime(), o = null, e.apply(r, i), o || (r = i =
				null)
		};
		return function() {
			var m = (new Date).getTime();
			a || !1 !== n.leading || (a = m);
			var u = t - (m - a);
			return r = this, i = arguments, u <= 0 || u > t ? (clearTimeout(o), o = null, a = m, e
				.apply(r, i), o || (r = i = null)) : o || !1 === n.trailing ? o && s && s.apply(
				r, i) : (o = setTimeout(c, u), s && s.apply(r, i)), o
		}
	}, c.get = function(e, t, n) {
		const s = t.replace(/\[(\d+)\]/g, ".$1").split(".");
		let r = e;
		for (const e of s)
			if (r = Object(r)[e], void 0 === r) return n;
		return r
	}, c.pickAsString = function(e, t) {
		if (!e) return "";
		return t.filter(t => void 0 !== e[t]).map(t => `${t}=${e[t]}`).join(",")
	}, c.omitAsString = function(e, t) {
		if (!e) return "";
		const n = {};
		t.forEach(e => {
			n[e] = !0
		});
		return Object.keys(e).filter(e => !n[e]).map(t => `${t}=${e[t]}`).join(",")
	};
	const p = {
		session: function(e) {
			const t = {
				...e
			};
			return ["topCustom", "localCustom", "extra"].forEach(e => {
				t[e] && (t[e] = "***")
			}), t.lastMsg && (t.lastMsg = {
				idServer: t.lastMsg.idServer,
				idClient: t.lastMsg.idClient
			}), t
		}
	};
	c.secureOutput = function(e, t) {
		Array.isArray(t) || (t = [t]);
		const n = p[e];
		return 1 === (t = t.map(e => n(e))).length ? t[0] : t
	};
	const g = {
		string: function(e, t, n) {
			const {
				required: s,
				allowEmpty: r
			} = n, i = e[t];
			return !1 === s && void 0 === i || "string" == typeof i && !(!r && "" === i)
		},
		number: function(e, t, n) {
			const {
				required: s,
				min: r
			} = n, i = e[t];
			return !1 === s && void 0 === i || "number" == typeof i && !(i < r)
		},
		enum: function(e, t, n) {
			const {
				required: s,
				values: r
			} = n, i = e[t];
			return !1 === s && void 0 === i || r.indexOf(i) > -1
		},
		array: function(e, t, n) {
			const {
				required: s
			} = n, r = e[t];
			return !1 === s && void 0 === r || !!Array.isArray(r)
		}
	};
	c.validate = function(e, t, n) {
		const s = {};
		return Object.keys(e).forEach(r => {
			const i = e[r].type,
				o = g[i];
			o && !o(t, r, e[r]) ? c.onError({
				message: `Error in parameter verification, ${r} expected value is ${JSON.stringify(e[r])}`,
				callFunc: n
			}) : s[r] = t[r]
		}), s
	}, c.asyncPool = function(e, t, n) {
		if ("number" != typeof e || "function" != typeof n || !t || !t.length) return Promise.resolve();
		let s = 0;
		const r = [],
			i = [],
			o = function() {
				if (s === t.length) return Promise.resolve();
				const a = t[s++],
					c = Promise.resolve().then(() => n(a, t));
				r.push(c);
				let m = Promise.resolve();
				if (e <= t.length) {
					const t = c.then(() => i.splice(i.indexOf(t), 1));
					i.push(t), i.length >= e && (m = Promise.race(i))
				}
				return m.then(() => o())
			};
		return o().then(() => Promise.all(r))
	}, c.getIdArray = function(e) {
		if (!e || "string" != typeof e) throw new Error("id type error");
		const t = e.indexOf("-");
		if (t < 0 || t === e.length - 1) throw new Error("id format error");
		return [e.slice(0, t), e.slice(t + 1)]
	}, e.exports = c
}, function(e, t, n) {
	n(0);
	var s = !1;
	try {
		"function" == typeof localStorage.setItem && "function" == typeof localStorage.getItem && (
			localStorage.setItem("nim_localstorage_exist_test", "1"), s = "1" === localStorage.getItem(
				"nim_localstorage_exist_test"), localStorage.removeItem("nim_localstorage_exist_test"))
	} catch (e) {
		s = !1
	}
	var r = {
		nodeEnv: "production",
		info: {
			hash: "fb4c1ede9b92256a3d7fd322a88a4e1221b86ab0",
			shortHash: "fb4c1ed",
			version: "8.9.100",
			sdkVersion: "2300",
			sdkHumanVersion: "8.9.100",
			protocolVersion: 1
		},
		lbsUrl: "https://lbs.netease.im/lbs/webconf.jsp",
		roomserver: "roomserver.netease.im",
		connectTimeout: 8e3,
		xhrTimeout: 8e3,
		socketTimeout: 8e3,
		reconnectionDelay: 1600,
		reconnectionDelayMax: 8e3,
		reconnectionJitter: .01,
		reconnectiontimer: null,
		heartbeatInterval: 3e4,
		cmdTimeout: 8e3,
		hbCmdTimeout: 5e3,
		defaultReportUrl: "https://dr.netease.im/1.gif",
		isWeixinApp: !1,
		isNodejs: !1,
		isRN: !1,
		ipVersion: 0,
		PUSHTOKEN: "",
		PUSHCONFIG: {},
		CLIENTTYPE: 16,
		PushPermissionAsked: !1,
		iosPushConfig: null,
		androidPushConfig: null,
		netDetectAddr: "https://roomserver-dev.netease.im/v1/sdk/detect/local",
		optionDefaultLinkUrl: "",
		defaultLinkUrl: "weblink.netease.im",
		ipv6DefaultLinkUrl: "weblink.netease.im",
		optionIpv6DefaultLinkUrl: "",
		wxDefaultLinkUrl: "wlnimsc0.netease.im",
		serverNosConfig: s ? {
			cdnDomain: localStorage.getItem("nim_cdn_domain") || "",
			objectPrefix: localStorage.getItem("nim_object_prefix") || ""
		} : {},
		hasLocalStorage: s,
		getDefaultLinkUrl: function(e) {
			var t, n;
			1 === r.ipVersion ? (t = r.optionIpv6DefaultLinkUrl, n = r.ipv6DefaultLinkUrl) : (t = r
				.optionDefaultLinkUrl, n = r.defaultLinkUrl);
			var s = t || (r.isWeixinApp ? r.wxDefaultLinkUrl : n);
			if (!s) return !1;
			const i = e ? "https" : "http",
				o = e ? "443" : "80";
			var a = s;
			return -1 === s.indexOf("http") && (a = i + "://" + a), -1 === s.indexOf(":") && (a =
				a + ":" + o), a
		},
		ipProbeAddr: {
			ipv4: "https://detect4.netease.im/test/",
			ipv6: "https://detect6.netease.im/test/"
		},
		formatSocketUrl: function({
			url: e,
			secure: t
		}) {
			const n = t ? "https" : "http";
			return -1 === e.indexOf("http") ? n + "://" + e : e
		},
		uploadUrl: "https://nos.netease.com",
		chunkUploadUrl: "https://wanproxy-web.127.net",
		commonMaxSize: 104857600,
		chunkSize: 4194304,
		chunkMaxSize: 4194304e4,
		replaceUrl: "https://{bucket}-nosdn.netease.im/{object}",
		downloadHost: "nos.netease.com",
		downloadHostList: ["nos.netease.com"],
		downloadUrl: "https://{bucket}-nosdn.netease.im/{object}",
		nosCdnEnable: !0,
		httpsEnabled: !1,
		threshold: 0,
		nosLbsUrls: ["http://wanproxy.127.net/lbs", "http://wanproxy-bj.127.net/lbs",
			"http://wanproxy-hz.127.net/lbs", "http://wanproxy-oversea.127.net/lbs"
		],
		genUploadUrl: function(e) {
			return r.uploadUrl + "/" + e
		},
		genChunkUploadUrl: function(e) {
			return r.chunkUploadUrl ? r.chunkUploadUrl + "/" + e.bucket + "/" + e.objectName : ""
		},
		genDownloadUrl: function({
			bucket: e,
			tag: t,
			expireSec: n
		}, s, i) {
			let o = +new Date,
				a = n ? "&survivalTime=" + n : "";
			if (i) return `https://${i}/${s}?createTime=${o}${a}`;
			let c = `${r.replaceUrl}?createTime=${o}${a}`;
			return c = r.genNosProtocolUrl(c), c.replace("{bucket}", e).replace("{object}", s)
		},
		genFileUrl: function({
			bucket: e,
			objectName: t
		}) {
			return r.genNosProtocolUrl(r.replaceUrl).replace("{bucket}", e).replace("{object}", t)
		},
		genNosProtocolUrl: function(e) {
			return /^http/.test(e) ? r.httpsEnabled && 0 !== e.indexOf("https://") && (e = e
					.replace("http", "https")) : e = r.httpsEnabled ? "https://" + e : "http://" +
				e, e
		}
	};
	e.exports = r
}, function(e, t, n) {
	var s = n(8),
		r = n(12),
		i = n(1),
		o = n(0),
		a = o.undef,
		c = n(51),
		m = n(19),
		u = n(21);
	const l = n(120);

	function d(e) {
		var t = this;
		o.verifyOptions(e, "appKey account token", "protocol::IMProtocol"), o.verifyCallback(e, [
			"onconnect", "onerror", "onwillreconnect", "ondisconnect", "onloginportschange",
			"onmyinfo", "onblacklist", "onmutelist", "onfriends", "onusers", "onrobots", "onteams",
			"onSuperTeams", "onsessions", "onSessionsWithMoreRoaming", "onStickTopSessions",
			"onroamingmsgs", "onofflinemsgs", "onofflinefiltermsgs", "onroamingsysmsgs",
			"onofflinesysmsgs", "onofflinefiltersysmsgs", "onofflinecustomsysmsgs",
			"onofflinefiltercustomsysmsgs", "onbroadcastmsg", "onbroadcastmsgs", "onsysmsgunread",
			"onsyncdone", "onteammembers", "onsyncteammembersdone", "onmsg", "onsysmsg",
			"oncustomsysmsg", "onupdatemyinfo", "onupdateuser", "onSyncUpdateServerSession",
			"onUpdateSuperTeamMember", "onCreateSuperTeam", "onUpdateSuperTeam",
			"onAddSuperTeamMembers", "onRemoveSuperTeamMembers", "onUpdateSuperTeamManagers",
			"onDismissSuperTeam", "onTransferSuperTeam", "onUpdateSuperTeamMembersMute",
			"onupdateteammember", "onCreateTeam", "onUpdateTeam", "onAddTeamMembers",
			"onRemoveTeamMembers", "onUpdateTeamManagers", "onDismissTeam", "onTransferTeam",
			"onUpdateTeamMembersMute", "onTeamMsgReceipt", "onupdatesession", "onQuickComment",
			"onDeleteQuickComment", "onPinMsgChange", "onupdatesysmsgunread", "onupdatesysmsg",
			"onsynccreateteam", "onsyncsupercreateteam", "onsyncmarkinblacklist",
			"onsyncmarkinmutelist", "onsyncfriendaction", "shouldIgnoreNotification",
			"shouldIgnoreMsg", "onDeleteMsgSelf", "shouldCountNotifyUnread",
			"onPushNotificationMultiportConfig", "onPushNotificationMultiportConfigUpdate",
			"onpushevents"
		], "protocol::IMProtocol"), t.db = e.api.db = new s({
			logger: e.logger,
			notifyError: function(e) {
				t.notifyError && t.notifyError("DB error", e)
			}
		}), r.call(t, e)
	}
	var p = r.fn,
		g = d.fn = d.prototype = Object.create(p);
	g.init = function() {
		p.init.call(this), m.IM.setProtocol(this), this.parser = m.IM, this.sendCmd.bind(this), this
			.socketUrls = [], this.syncing = !0, this.hasSynced = !1, this.hasSyncedTeamMembers = !1,
			this.syncPromiseArray = [], this.syncResult = {}, this.syncTeamMembersPromiseArray = [],
			this.syncSuperTeamMembersPromiseArray = [], this.syncTeamMembersResult = {}, this
			.timetags = {}, this.superTeamMembersData = {}, this.saveAck = {}, this.sysMsgUnread = u
			.completeUnread({}), this.resetUnsettledMsgs(), this.resetUnsettledSysMsgs(), this
			.msgPromise = Promise.resolve(), this.sysMsgPromise = Promise.resolve(), this
			.msgDelayArr = [], this.msgDelayTimer = null, this.msgStatEnable = !1, this
			.nosCdnHostTimer = null, this.relativeServerTime = 0, this.sessionSet = {}, this
			.msgReceiptTasks = {}, this.userSet = {}, this.pushNotificationMultiportConfig = c
			.getDefaultConfig(), this.msgAckBufferManager = new l({
				processFn: this.handleMsgsAck.bind(this),
				throttleTime: 500
			})
	}, g.reset = function() {
		p.reset.call(this);
		var e = this.options;
		this.db.reset(e.db), a(e.lbsUrl) && (e.lbsUrl = i.lbsUrl), a(e.thumbnailToStatic) && (e
			.thumbnailToStatic = !0), this.autoconnect = !!e.autoconnect, this.resetAutoMarkRead()
	}, g.resetAutoMarkRead = function() {
		var e = this.options;
		o.verifyBooleanWithDefault(e, "autoMarkRead", !0, "", "protocol::resetAutoMarkRead")
	}, g.resetUnsettledMsgs = function() {
		this.unhandledMsgs = [], this.unupdatedMsgs = []
	}, g.resetUnsettledSysMsgs = function() {
		this.unhandledSysMsgs = [], this.unupdatedSysMsgs = []
	}, g.packetFromSync = function(e) {
		return !e.obj || !!e.obj.sync
	}, e.exports = d, n(121), n(122), n(123), n(124), n(126), n(127), n(128), n(129), n(130), n(131), n(
		132), n(133), n(134), n(135), n(136), n(137), n(138), n(139), n(140), n(141), n(142)
}, function(e, t, n) {
	var s = n(7),
		r = n(2),
		i = n(1),
		o = n(143),
		a = n(19).IM;

	function c(e) {
		return this.subType = "im", this.nosScene = e.nosScene || "im", this.nosSurvivalTime = e
			.nosSurvivalTime, e.Protocol = r, e.Message = o, e.constructor = c, this.init(e)
	}
	c.Protocol = r, c.parser = a, c.use = s.use, c.getInstance = s.getInstance, c.rmAllInstances = s
		.rmAllInstances, c.genInstanceName = function(e) {
			return "NIM-account-" + e.account
		};
	var m = c.fn = c.prototype = Object.create(s.prototype);
	c.info = m.info = i.info, e.exports = c, n(154), n(155), n(156), n(157), n(158), n(159), n(160), n(161),
		n(162), n(163), n(164), n(165), n(166), n(167), n(168), n(169), n(170), n(171), n(172), n(175), n(
			176)
}, function(e, t) {
	function n(e, t, n = {}) {
		this.message = e || n.message || "", "object" == typeof t ? (this.event = t, this.code =
				"Other_Error") : void 0 !== t && (this.code = t), this.timetag = +new Date, void 0 !== n &&
			(this.event = n), this.event && (this.callFunc = this.event.callFunc || null, delete this.event
				.callFunc)
	}
	n.prototype = Object.create(Error.prototype), n.prototype.name = "NIMError";
	var s = {
		201: "客户端版本不对, 需升级sdk",
		302: "用户名或密码错误, 请检查appKey和token是否有效, account和token是否匹配",
		403: "非法操作或没有权限",
		404: "对象(用户/群/聊天室)不存在",
		405: "参数长度过长",
		408: "客户端请求超时",
		414: "参数错误",
		415: "服务不可用/没有聊天室服务器可分配",
		416: "频率控制",
		417: "重复操作",
		422: "帐号被禁用",
		500: "服务器内部错误",
		501: "数据库操作失败",
		503: "服务器繁忙",
		508: "删除有效期过了",
		509: "已失效",
		7101: "被拉黑",
		700: "批量操作部分失败",
		801: "群人数达到上限",
		802: "没有权限",
		803: "群不存在或未发生变化",
		804: "用户不在群里面",
		805: "群类型不匹配",
		806: "创建群数量达到限制",
		807: "群成员状态不对",
		809: "已经在群里",
		811: "强推列表中帐号数量超限",
		812: "群被禁言",
		813: "因群数量限制，部分拉人成功",
		814: "禁止使用群组消息已读服务",
		815: "群管理员人数上限",
		816: "批量操作部分失败",
		997: "协议已失效",
		998: "解包错误",
		999: "打包错误",
		9102: "通道失效",
		9103: "已经在其他端接听/拒绝过这通电话",
		11001: "对方离线, 通话不可送达",
		13002: "聊天室状态异常",
		13003: "在黑名单中",
		13004: "在禁言名单中",
		13006: "聊天室处于整体禁言状态,只有管理员能发言",
		Connect_Failed: "无法建立连接, 请确保能 ping/telnet 到云信服务器; 如果是IE8/9, 请确保项目部署在 HTTPS 环境下",
		Error_Internet_Disconnected: "网断了",
		Error_Connection_is_not_Established: "连接未建立",
		Error_Connection_Socket_State_not_Match: "socket状态不对",
		Error_Timeout: "超时",
		Param_Error: "参数错误",
		No_File_Selected: "请选择文件",
		Wrong_File_Type: "文件类型错误",
		File_Too_Large: "文件过大",
		Cross_Origin_Iframe: "不能获取跨域Iframe的内容",
		Not_Support: "不支持",
		NO_DB: "无数据库",
		DB: "数据库错误",
		Still_In_Team: "还在群里",
		Session_Exist: "会话已存在",
		Session_Not_Exist: "会话不存在",
		Error_Unknown: "未知错误",
		Operation_Canceled: "操作取消"
	};
	[200, 406, 808, 810].forEach(e => {
		s[e] = null
	}), n.genError = function(e) {
		var t = s[e];
		return void 0 === t && (t = "操作失败"), null === t ? null : new n(t, e)
	}, n.multiInstance = function(e) {
		return new n("不允许初始化多个实例", "Not_Allow_Multi_Instance", e)
	}, n.newNetworkError = function(e) {
		var t = "Error_Internet_Disconnected";
		return new n(s[t], t, e)
	}, n.newConnectError = function(e) {
		var t = "Connect_Failed";
		return new n(s[t] || null, t, e)
	}, n.newConnectionError = function(e) {
		var t = "Error_Connection_is_not_Established";
		return new n(s[t], t, e)
	}, n.newSocketStateError = function(e) {
		var t = "Error_Connection_Socket_State_not_Match";
		return new n(s[t], t, e)
	}, n.newTimeoutError = function(e) {
		var t = "Error_Timeout";
		return new n(s[t], t, e)
	}, n.newFrequencyControlError = function(e) {
		var t = new n(s[416], 416, e);
		return t.from = "local", t
	}, n.newParamError = function(e, t) {
		return new n(e || s.Param_Error, "Param_Error", t)
	}, n.newNoFileError = function(e, t) {
		var r = "No_File_Selected";
		return new n(e || s[r], r, t)
	}, n.newWrongFileTypeError = function(e, t) {
		var r = "Wrong_File_Type";
		return new n(e || s[r], r, t)
	}, n.newFileTooLargeError = function(e, t) {
		var r = "File_Too_Large";
		return new n(e || s[r], r, t)
	}, n.newCORSIframeError = function(e) {
		var t = "Cross_Origin_Iframe";
		return new n(s[t], t, e)
	}, n.newSupportError = function(e, t, s) {
		return new n("不支持" + e, "Not_Support_" + t, s)
	}, n.newSupportDBError = function(e) {
		return n.newSupportError("数据库", "DB", e)
	}, n.noDBError = function(e) {
		return new n(s.NO_DB, "NO_DB", e)
	}, n.newDBError = function(e) {
		return new n(s.DB, "DB", e)
	}, n.newUnknownError = function(e) {
		var t = "Error_Unknown";
		return new n(s[t], t, e)
	}, n.stillInTeamError = function(e) {
		var t = "Still_In_Team";
		return new n(s[t], t, e)
	}, n.sessionExist = function(e) {
		var t = "Session_Exist";
		return new n(s[t], t, e)
	}, n.sessionNotExist = function(e) {
		var t = "Session_Not_Exist";
		return new n(s[t], t, e)
	}, n.cancel = function(e) {
		var t = "Operation_Canceled";
		return new n(s[t], t, e)
	}, n.customError = function(e, t) {
		e = e || "Other_Error";
		let r = "";
		return (t = t || {}).message || (r = s[e] || e), "object" != typeof e ? new n(r, e, t) : new n(
			r, "Other_Error", void 0 === t ? e : t)
	}, e.exports = n
}, function(e, t, n) {
	var s = n(0),
		r = {
			init: function() {
				r.deviceId = s.guid()
			}
		};
	r.init(), r.clientTypeMap = {
		1: "Android",
		2: "iOS",
		4: "PC",
		8: "WindowsPhone",
		16: "Web",
		32: "Server",
		64: "Mac"
	}, r.db = {
		open() {}
	}, r.rnfs = null, e.exports = r
}, function(e, t, n) {
	(function(t) {
		function n() {
			return "undefined" != typeof window ? window : void 0 !== t ? t : "undefined" !=
				typeof self ? self : {}
		}

		function s(e, t) {
			t = t || 2;
			let n = "" + e;
			for (; n.length < t;) n = "0" + n;
			return n
		}

		function r(e) {
			return "" + e.getFullYear()
		}

		function i(e) {
			return s(e.getMonth() + 1)
		}

		function o(e) {
			return s(e.getDate())
		}

		function a(e) {
			return s(e.getHours())
		}

		function c(e) {
			return s(e.getMinutes())
		}

		function m(e) {
			return s(e.getSeconds())
		}

		function u(e) {
			return s(e.getMilliseconds(), 3)
		}
		const l = (d = /yyyy|MM|dd|hh|mm|ss|SSS/g, p = {
			yyyy: r,
			MM: i,
			dd: o,
			hh: a,
			mm: c,
			ss: m,
			SSS: u
		}, function(e, t) {
			return e = new Date(e), isNaN(+e) ? "invalid date" : (t = t || "yyyy-MM-dd")
				.replace(d, (function(t) {
					return p[t](e)
				}))
		});
		var d, p;

		function g(e) {
			return Object.prototype.toString.call(e).slice(8, -1)
		}

		function f(e) {
			return g(e).toLowerCase()
		}

		function h(e) {
			return "string" === f(e)
		}

		function y(e) {
			return "number" === f(e)
		}

		function v(e) {
			return "array" === f(e)
		}

		function b(e) {
			return "function" == typeof e
		}

		function T(e) {
			return "date" === f(e)
		}

		function S(e) {
			return null === e
		}

		function M(e) {
			return null !== e
		}

		function k(e) {
			return void 0 === e
		}

		function C(e) {
			return void 0 !== e
		}

		function P(e) {
			return C(e) && M(e)
		}

		function I(e) {
			return k(e) || S(e)
		}

		function A(e) {
			return P(e) && "object" === f(e)
		}
		const w = (e, t, n) => {
				e.addEventListener ? e.addEventListener(t, n, !1) : e.attachEvent && e.attachEvent(
					"on" + t, n)
			},
			x = w,
			O = (e, t, n) => {
				e.removeEventListener ? e.removeEventListener(t, n, !1) : e.detachEvent && e
					.detachEvent("on" + t, n)
			},
			_ = O;

		function E(e = {}, t = (() => {}), n) {
			for (const s in e) e.hasOwnProperty(s) && t.call(n, s, e[s])
		}

		function R(e, t) {
			E(t, (t, n) => {
				e[t] = n
			})
		}
		const U = (() => {
			let e = 0;
			return () => "" + e++
		})();

		function j(e) {
			return h(e) && 0 === e.indexOf("{") && e.lastIndexOf("}") === e.length - 1
		}

		function D(e, t, n) {
			if (!e) return "";
			const s = [];
			return E(e, (e, t) => {
				b(t) || (T(t) ? t = t.getTime() : v(t) ? t = t.join(",") : A(t) && (t = JSON
					.stringify(t)), n && (t = encodeURIComponent(t)), s.push(
					encodeURIComponent(e) + "=" + t))
			}), s.join(t || ",")
		}
		const L = (() => {
			const e = /^([\w]+?:\/\/.*?(?=\/|$))/i;
			return t => e.test(t || "") ? RegExp.$1.toLowerCase() : ""
		})();

		function N(e) {
			var t = n();
			return e.tagName && "INPUT" === e.tagName.toUpperCase() || t.Blob && e instanceof t.Blob
		}
		e.exports = {
			o: {},
			emptyObj: {},
			f: () => {},
			emptyFunc: () => {},
			regBlank: /\s+/gi,
			regWhiteSpace: /\s+/gi,
			getGlobal: n,
			detectCSSFeature: function(e) {
				let t = !1;
				const n = "Webkit Moz ms O".split(" ");
				if ("undefined" == typeof document) return;
				const s = document.createElement("div");
				let r = null;
				if (e = e.toLowerCase(), void 0 !== s.style[e] && (t = !0), !1 === t) {
					r = e.charAt(0).toUpperCase() + e.substr(1);
					for (let e = 0; e < n.length; e++)
						if (void 0 !== s.style[n[e] + r]) {
							t = !0;
							break
						}
				}
				return t
			},
			fix: s,
			getYearStr: r,
			getMonthStr: i,
			getDayStr: o,
			getHourStr: a,
			getMinuteStr: c,
			getSecondStr: m,
			getMillisecondStr: u,
			format: l,
			dateFromDateTimeLocal: function(e) {
				return e = "" + e, new Date(e.replace(/-/g, "/").replace("T", " "))
			},
			getClass: g,
			typeOf: f,
			isString: h,
			isNumber: y,
			isInt: function(e) {
				return y(e) && e % 1 == 0
			},
			isBoolean: function(e) {
				return "boolean" === f(e)
			},
			isArray: v,
			isFunction: b,
			isDate: T,
			isRegExp: function(e) {
				return "regexp" === f(e)
			},
			isError: function(e) {
				return "error" === f(e)
			},
			isnull: S,
			notnull: M,
			undef: k,
			notundef: C,
			exist: P,
			notexist: I,
			isObject: A,
			isEmpty: function(e) {
				return I(e) || (h(e) || v(e)) && 0 === e.length
			},
			containsNode: function(e, t) {
				if (e === t) return !0;
				for (; t.parentNode;) {
					if (t.parentNode === e) return !0;
					t = t.parentNode
				}
				return !1
			},
			calcHeight: function(e) {
				const t = e.parentNode || ("undefined" == typeof document ? null : document
					.body);
				if (!t) return 0;
				(e = e.cloneNode(!0)).style.display = "block", e.style.opacity = 0, e.style
					.height = "auto", t.appendChild(e);
				const n = e.offsetHeight;
				return t.removeChild(e), n
			},
			remove: function(e) {
				e.parentNode && e.parentNode.removeChild(e)
			},
			dataset: function(e, t, n) {
				if (!P(n)) return e.getAttribute("data-" + t);
				e.setAttribute("data-" + t, n)
			},
			addEventListener: w,
			on: x,
			removeEventListener: O,
			off: _,
			target: function(e) {
				return e.target || e.srcElement
			},
			createIframe: function(e) {
				if ("undefined" != typeof document) {
					var t;
					if ((e = e || {}).name) try {
						(t = document.createElement('<iframe name="' + e.name +
							'"></iframe>')).frameBorder = 0
					} catch (n) {
						(t = document.createElement("iframe")).name = e.name
					} else t = document.createElement("iframe");
					e.visible || (t.style.display = "none"), b(e.onload) && x(t, "load", (
						function n(s) {
							t.src && (e.multi || _(t, "load", n), e.onload(s))
						})), (e.parent || document.body).appendChild(t);
					var n = e.src || "about:blank";
					return setTimeout(() => {
						t.src = n
					}, 0), t
				}
			},
			html2node: function(e) {
				if ("undefined" == typeof document) return;
				const t = document.createElement("div");
				t.innerHTML = e;
				const n = [];
				let s, r;
				if (t.children)
					for (s = 0, r = t.children.length; s < r; s++) n.push(t.children[s]);
				else
					for (s = 0, r = t.childNodes.length; s < r; s++) {
						var i = t.childNodes[s];
						1 === i.nodeType && n.push(i)
					}
				return n.length > 1 ? t : n[0]
			},
			scrollTop: function(e) {
				return "undefined" != typeof document && P(e) && (document.documentElement
						.scrollTop = document.body.scrollTop = e), window.pageYOffset ||
					document.documentElement.scrollTop || document.body.scrollTop || 0
			},
			forOwn: E,
			mixin: R,
			uniqueID: U,
			isJSON: j,
			parseJSON: function e(t) {
				try {
					j(t) && (t = JSON.parse(t)), A(t) && E(t, (n, s) => {
						switch (f(s)) {
							case "string":
							case "object":
								t[n] = e(s)
						}
					})
				} catch (e) {}
				return t
			},
			simpleClone: function(e) {
				var t = [],
					n = JSON.stringify(e, (function(e, n) {
						if ("object" == typeof n && null !== n) {
							if (-1 !== t.indexOf(n)) return;
							t.push(n)
						}
						return n
					}));
				return JSON.parse(n)
			},
			merge: function(e = {}, ...t) {
				return t.forEach(t => {
					R(e, t)
				}), e
			},
			fillUndef: function(e, t) {
				return E(t, (t, n) => {
					k(e[t]) && (e[t] = n)
				}), e
			},
			checkWithDefault: function(e, t, n) {
				let s = e[t] || e[t.toLowerCase()];
				return I(s) && (s = n, e[t] = s), s
			},
			fetch: function(e, t) {
				return E(e, (n, s) => {
					P(t[n]) && (e[n] = t[n])
				}), e
			},
			string2object: function(e = "", t = ",") {
				const n = {};
				return e.split(t).forEach(e => {
					const t = e.split("="),
						s = t.shift();
					s && (n[decodeURIComponent(s)] = decodeURIComponent(t.join("=")))
				}), n
			},
			object2string: D,
			genUrlSep: function(e) {
				return e.indexOf("?") < 0 ? "?" : "&"
			},
			object2query: function(e) {
				return D(e, "&", !0)
			},
			url2origin: L,
			isFileInput: N,
			getKeys: function(e, t) {
				var n = Object.keys(e);
				return t && n.sort((function(t, n) {
					var s = N(e[t]);
					return s === N(e[n]) ? 0 : s ? 1 : -1
				})), n
			},
			_get: function(e, t, n) {
				const s = t.replace(/\[(\d+)\]/g, ".$1").split(".");
				let r = e;
				for (const e of s)
					if (r = Object(r)[e], void 0 === r) return n;
				return r
			},
			getLastSeveralItems: function(e, t) {
				const n = e.length,
					s = [];
				for (let t = 0; t < n; t++) {
					const n = e[t].map(e => ({
						...e,
						flag: "sort_flag_" + t
					}));
					s.push(...n)
				}
				s.sort((e, t) => e.startTime - t.startTime);
				const r = [];
				for (let e = 0; e < n; e++) r[e] = s.filter(t => t.flag === "sort_flag_" + e)
					.map(e => ({
						...e,
						flag: void 0
					}));
				return r
			}
		}
	}).call(this, n(14))
}, function(e, t, n) {
	const s = n(59),
		r = n(0),
		i = r.notundef,
		o = n(60),
		a = n(1),
		c = n(9);

	function m() {}
	var u = {};
	m.getInstance = function(e) {
		e = d(e), r.verifyOptions(e, "account", "api::Base.getInstance");
		var t = this.genInstanceName(e),
			n = u[t];
		return n ? m.updateInstance(n, e) : n = u[t] = new this(e), n
	}, m.updateInstance = function(e, t) {
		e.setOptions(t), e.connect()
	};
	var l = m.fn = m.prototype = Object.create(new s),
		d = function(e) {
			return e.nosSurvivalTime ? (r.verifyParamType("nosSurvivalTime", e.nosSurvivalTime, "number",
				"api::Base.getInstance"), r.verifyParamMin("nosSurvivalTime", e.nosSurvivalTime,
				86400, "api::Base.getInstance")) : e.nosSurvivalTime = 1 / 0, e
		};
	l.updatePrivateConf = function(e) {
		if (e && "object" == typeof e.privateConf) {
			const t = e.privateConf;
			"string" == typeof t.lbs_web && (e.lbsUrl = t.lbs_web), "boolean" == typeof t
				.link_ssl_web && (e.secure = t.link_ssl_web), "boolean" == typeof t.https_enabled && (e
					.httpsEnabled = t.https_enabled), e.uploadUrl = t.nos_uploader_web ? t
				.nos_uploader_web : null, e.chunkUploadUrl = t.nos_uploader_web ? t.nos_uploader_web :
				null, e.replaceUrl = t.nos_downloader ? t.nos_downloader : null, e.downloadUrl = t
				.nos_accelerate ? t.nos_accelerate : null, e.downloadHost = t.nos_accelerate_host ? t
				.nos_accelerate_host : null, e.downloadHostList = t.nos_accelerate_host_list || [], e
				.downloadHost && e.downloadHostList.push(e.downloadHost), e.nosCdnEnable = !1 !== t
				.nos_cdn_enable, e.ntServerAddress = t.nt_server || null, e.kibanaServer = t
				.kibana_server, e.statisticServer = t.statistic_server, e.reportGlobalServer = t
				.report_global_server, e.ipVersion = t.ip_protocol_version, e.defaultLink = t
				.link_web || e.defaultLink, e.ipv6DefaultLink = t.link_ipv6_web || e.ipv6DefaultLink,
				"string" == typeof t.nos_lbs ? e.nosLbsUrls = [t.nos_lbs] : e.nosLbsUrls = []
		}
		return null === e.ntServerAddress || "" === e.ntServerAddress ? a.ntServerAddress = null : a
			.ntServerAddress = e.ntServerAddress || a.defaultReportUrl, a.uploadUrl = e.uploadUrl || a
			.uploadUrl, a.chunkUploadUrl = e.chunkUploadUrl || a.chunkUploadUrl, a.downloadUrl = e
			.downloadUrl || a.downloadUrl, a.downloadHost = e.downloadHost || a.downloadHost, a
			.downloadHostList = e.downloadHostList && e.downloadHostList.length > 0 ? e
			.downloadHostList : a.downloadHostList, a.nosCdnEnable = !1 !== e.nosCdnEnable, a
			.replaceUrl = e.replaceUrl || a.replaceUrl, a.httpsEnabled = e.httpsEnabled || a
			.httpsEnabled, e.probe_ipv4_url && (a.ipProbeAddr.ipv4 = e.probe_ipv4_url), e
			.probe_ipv6_url && (a.ipProbeAddr.ipv6 = e.probe_ipv6_url), e
	}, l.init = function(e) {
		r.verifyOptions(e, "account", "api::Base.init"), e = this.updatePrivateConf(e), r
			.verifyBooleanWithDefault(e, "exifOrientation", !0, "", "api::Base.init"), e.lbsBackup =
			void 0 === e.lbsBackup || e.lbsBackup;
		var t = this.account = e.account = e.account + "",
			n = e.constructor.genInstanceName(e),
			s = u[n];
		if (e._disableSingleton && (s = null), s) return m.updateInstance(s, e), s;
		this.name = n, u[n] = this, this.logger = e.logger = new o({
			debug: e.debug,
			logFunc: e.logFunc,
			prefix: this.subType,
			dbLog: !1 !== e.dbLog,
			account: e.account,
			expire: e.expire
		}), e.api = this;
		var i = this.protocol = new e.Protocol(e);
		return i.name = "Protocol-" + n, i.account = t, i.api = this, i.message = this.message = new e
			.Message({
				account: t
			}), this.options = r.copy(e), this
	}, l.destroy = function(e) {
		var t, n = this;
		if (n.__beginDestroy) return;
		n.__beginDestroy = !0, e = e || {};
		const s = this.name;
		if (this.logger.warn("destroy::start"), !s) return this.logger && this.logger.warn && this
			.logger.warn("destroy::no instanceName"), void(n.__beginDestroy = void 0);
		this.protocol && (t = this.protocol.connectTimer), this.protocol && this.protocol.resetPush &&
			this.protocol.resetPush(), this.eventNames && "function" == typeof this.eventNames && this
			.eventNames().forEach(e => {
				delete this._events[e]
			}), this.disconnect({
				done: function(r) {
					n.logger.warn("ApiBase::destroy: instance destroyed ..."), n
						.__beginDestroy = void 0, c.destroy(), Object.getOwnPropertyNames(n
							.options).forEach(e => {
							0 === e.indexOf("on") && (n.options[e] = function() {}, n
								.protocol.options[e] = function() {}, n.protocol.api
								.options[e] = function() {})
						}), n.logger.setLogDisabled(), Object.getOwnPropertyNames(n).forEach(
							e => {
								n[e] = void 0
							}), u && (u[s] = null, clearTimeout(t)), e
						.done instanceof Function && e.done(r)
				}
			})
	}, l.setOptions = function(e) {
		this.protocol.setOptions(e)
	}, l.processCallback = function(e, t) {
		p(e, t)
	}, l.processCallbackPromise = function(e, t) {
		return new Promise((function(n, s) {
			p(e, t, !0, n, s)
		}))
	};
	const p = function(e, t, n, s, o) {
		var a = "api::processCallback";
		n && (a = "api::processCallbackPromise"), r.verifyCallback(e, "done", a), e.callback = function(
			c, m, u) {
			var l = e.callback.options;
			if (m = m || l, t && (m = l), r.isFunction(e.cbaop)) {
				var d = e.cbaop(c, m);
				i(d) && (m = d)
			}
			var p = e.done;
			r.isObject(m) && (delete m.done, delete m.cb, delete m.callback), n ? c ? o({
				message: "生成接口回调错误",
				callFunc: a,
				event: c
			}) : s(m) : p(c, m, u)
		}, e.callback.options = r.copy(e)
	};
	l.processPs = function(e) {
		r.notexist(e.ps) && (e.ps = ""), r.verifyArrayMax("ps", e.ps, 5e3)
	}, l.processCustom = function(e) {
		r.notexist(e.custom) && (e.custom = "")
	}, l.sendCmd = function() {
		this.protocol.sendCmd.apply(this.protocol, arguments)
	}, l.sendCmdWithResp = function(e, t, n) {
		this.sendCmd(e, t, (function(e, t, s) {
			r.isFunction(n) && (e ? n(e, t) : n(null, s))
		}))
	}, l.cbAndSendCmd = function(e, t) {
		var n = this.processCallbackPromise(t);
		return this.sendCmd(e, t), n
	}, l.sendCmdUsePromise = function(e, t) {
		return new Promise((n, s) => {
			this.sendCmd(e, t, (function(e, t, i) {
				if (e) s(e);
				else {
					const e = r.merge({}, t, i);
					n(e)
				}
			}))
		})
	}, m.use = function(e, t) {
		e && e.install && r.isFunction(e.install) && e.install(this, t)
	}, m.rmAllInstances = function() {
		for (let e in u) u[e].destroy();
		u = {}
	}, l.logout = function(e) {
		e = e || {}, this.protocol.shouldReconnect = !1, this.protocol.doLogout = !0, this
			.processCallback(e), this.sendCmd("logout", e, e.callback)
	}, e.exports = m, n(72), n(73), n(76), n(77), n(78), n(79), n(80)
}, function(e, t, n) {
	let s = n(108);
	s.fn = s.prototype, e.exports = s, n(109), n(110), n(111), n(112), n(113), n(114), n(115), n(116), n(
		117), n(118), n(119)
}, function(e, t, n) {
	const s = n(10),
		r = n(11),
		i = n(0);
	var o = n(5),
		a = n(1);
	const c = n(6),
		m = "https://statistic.live.126.net/statics/report/common/form",
		u = "nimErrEvent",
		l = {
			sdktype: "IM",
			platform: "Web",
			deviceId: o.deviceId,
			sdk_ver: a.info.version,
			manufactor: r.manufacturer,
			env: "online"
		},
		d = {
			login: "nimLoginErrEvent",
			nos: "nimNosErrEvent"
		},
		p = {
			login: null,
			nos: null
		};
	let g = {
			maxInterval: 30,
			maxSize: 100,
			minInterval: 10,
			maxDelay: 100,
			turnOn: !1
		},
		f = null,
		h = !1;
	const y = {
		reportErrEventUrl: m,
		localKey: u,
		reportErrEvent: function(e) {
			try {
				var t = localStorage.getItem(u);
				if (!t) return;
				t = JSON.parse(t);
				var n = [];
				Object.keys(t).forEach(e => {
					n.push(t[e])
				});
				var i = {
					app_key: e.appKey,
					sdk_ver: e.sdk_ver,
					platform: "Web",
					os_ver: r.os.family + " " + r.os.version,
					manufacturer: r.manufacturer,
					model: r.name
				};
				s(m, {
					method: "POST",
					timeout: 2e3,
					headers: {
						"Content-Type": "application/json"
					},
					data: JSON.stringify({
						common: {
							device_id: e.deviceId,
							sdk_type: "IM"
						},
						event: {
							logReport: n,
							deviceinfo: i
						}
					}),
					onload: () => {
						localStorage.removeItem(u)
					},
					onerror: e => {}
				})
			} catch (e) {}
		},
		saveErrEvent: function(e = {}) {
			if (e.code && e.module) try {
				var t = localStorage.getItem(u) || "{}";
				t = JSON.parse(t);
				var n = e.code + e.module + e.accid;
				t[n] ? t[n].count++ : t[n] = {
					errorCode: e.code,
					module: e.module,
					accid: e.accid,
					timestamp: (new Date).getTime(),
					count: 1
				}, localStorage.setItem(u, JSON.stringify(t))
			} catch (e) {}
		},
		initUniErrReport: function(e = {}) {
			l.appkey = e.appKey, s(
				`https://statistic.live.126.net/dispatcher/req?deviceId=${l.deviceId}&sdktype=${l.sdktype}&sdkVer=${l.sdk_ver}&platform=${l.platform}&appkey=${l.appkey}`, {
					method: "get",
					onload: e => {
						let t = null;
						try {
							t = JSON.parse(e)
						} catch (e) {}
						t && t.code && 200 === t.code && (g = t.data, g.maxInterval = g
							.maxInterval > 1e4 ? 1e4 : g.maxInterval, g.maxInterval = g
							.maxInterval < 10 ? 10 : g.maxInterval, g.maxSize = g
							.maxSize > 1e3 ? 1e3 : g.maxSize, g.minInterval = g
							.minInterval < 2 ? 2 : g.minInterval, g.maxDelay = g
							.maxDelay > 600 ? 600 : g.maxDelay, 200 === t.code && (g
								.turnOn = !0, f = setInterval(() => {
									y.checkUniErrCache(!0)
								}, 1e3 * g.maxInterval)))
					},
					onerror: e => {}
				})
		},
		startUniErrCache: function(e, t = {}) {
			if (!p.hasOwnProperty(e)) return;
			if (p[e]) return;
			if (!t.user_id || !t.action) return;
			const n = (new Date).valueOf();
			p[e] = {
				user_id: t.user_id,
				action: t.action,
				start_time: n,
				extension: []
			}
		},
		updateUniErrCache: function(e, t = {}) {
			if (!p.hasOwnProperty(e)) return;
			if (!p[e] || !p[e].extension) return;
			if (!Array.isArray(p[e].extension)) return;
			let {
				operation_type: n,
				code: s,
				target: r,
				...i
			} = t;
			var o = p[e].extension.reduce((e, t) => e + t.duration, 0),
				a = (new Date).getTime() - o - p[e].start_time;
			t.error && t.error.code && (s = t.error.code), p[e].extension.push({
				operation_type: n,
				code: s,
				succeed: !1,
				target: r,
				duration: a,
				description: JSON.stringify(i)
			})
		},
		updateUniSuccCache: function(e, t = {}) {
			if (!p.hasOwnProperty(e)) return;
			if (!p[e] || !p[e].extension) return;
			if (!Array.isArray(p[e].extension)) return;
			const {
				operation_type: n,
				code: s,
				target: r,
				...i
			} = t;
			var o = p[e].extension.reduce((e, t) => e + t.duration, 0),
				a = (new Date).getTime() - o - p[e].start_time;
			p[e].extension.push({
				operation_type: n,
				code: 200,
				succeed: !0,
				target: r,
				duration: a,
				description: JSON.stringify(i)
			})
		},
		concludeUniErrCache: function(e, t = 0) {
			if (!p.hasOwnProperty(e)) return;
			if (!p[e]) return;
			if ("nos" === e && 0 === t) return void(p[e] = null);
			const n = (new Date).valueOf();
			p[e].succeed = !t, p[e].duration = n - p[e].start_time;
			const s = i.copy(p[e]);
			p[e] = null;
			try {
				const t = localStorage.getItem(d[e]) || "[]",
					n = JSON.parse(t);
				n.push(s), localStorage.setItem(d[e], JSON.stringify(n)), g.turnOn && y
					.checkUniErrCache()
			} catch (e) {}
		},
		checkUniErrCache: function(e = !1) {
			if (h) return;
			const t = (new Date).valueOf();
			try {
				const n = localStorage.getItem(d.login) || "[]",
					r = localStorage.getItem(d.nos) || "[]",
					i = JSON.parse(n),
					o = JSON.parse(r),
					a = i.filter(e => t - e.start_time < 1e3 * g.maxDelay),
					u = o.filter(e => t - e.start_time < 1e3 * g.maxDelay),
					[p, v] = c.getLastSeveralItems([a, u], g.maxSize);
				if (p.length + v.length === g.maxSize || e) {
					if (p.length + v.length === 0) return;
					const {
						appkey: e,
						platform: t,
						sdk_ver: n,
						manufactor: r,
						env: i
					} = l, o = {
						common: {
							app_key: e,
							platform: t,
							sdk_ver: n,
							manufactor: r,
							env: i
						},
						event: {
							login: [...p],
							nos: [...v]
						}
					};
					s(m, {
						method: "POST",
						timeout: 2e3,
						headers: {
							"Content-Type": "application/json",
							sdktype: l.sdktype
						},
						data: JSON.stringify(o),
						onload() {
							for (const e in d)
								if (Object.hasOwnProperty.call(d, e)) {
									const t = d[e];
									localStorage.setItem(t, "[]")
								} clearInterval(f), f = setInterval(() => {
								y.checkUniErrCache(!0)
							}, 1e3 * g.maxInterval), h = !1
						},
						onerror() {
							h = !1
						}
					}), h = !0
				}
			} catch (e) {
				h = !1
			}
		},
		pause: function() {
			l.turnOn = !1
		},
		restore: function() {
			l.turnOn = !0
		},
		destroy: function() {
			f && clearInterval(f), y.concludeUniErrCache("login", 1), y.concludeUniErrCache("nos",
				1), l.turnOn = !1, h = !1
		}
	};
	y.sendBeacon = navigator && navigator.sendBeacon && navigator.sendBeacon.bind(navigator) || function(e,
		t) {
		var n = new XMLHttpRequest;
		n.open("POST", e, !0), n.send(t)
	}, e.exports = y
}, function(e, t, n) {
	const s = n(18),
		r = n(69),
		i = n(70),
		o = n(71);
	s.json = r, s.upload = i, s.chunkUpload = o, e.exports = s
}, function(e, t) {
	e.exports = {
		description: "weixin micro app",
		layout: null,
		manufacturer: null,
		name: "weixin",
		prerelease: null,
		product: null,
		ua: "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) Weixin/1.9.1",
		version: "1.9.1",
		os: {
			architecture: 64,
			family: "Windows",
			version: "1.9.1"
		}
	}
}, function(e, t, n) {
	var s = n(0),
		r = n(1),
		i = n(9),
		o = n(4);

	function a(e) {
		s.undef(e.secure) && (e.secure = !0), this.options = s.copy(e), this.keepNosSafeUrl = this.options
			.keepNosSafeUrl || !1;
		var t = e.defaultLink || e.defaultLinkUrl;
		s.notundef(t) && s.isString(t) && (r.optionDefaultLinkUrl = t.trim()), s.notundef(e
			.ipv6DefaultLink) && s.isString(e.ipv6DefaultLink) && (r.optionIpv6DefaultLinkUrl = e
				.ipv6DefaultLink), "number" == typeof e.heartbeatInterval && (r.heartbeatInterval = e
				.heartbeatInterval), Array.isArray(e.nosLbsUrls) && (r.nosLbsUrls = e.nosLbsUrls), this
			.init(), this.connect()
	}
	var c = a.fn = a.prototype;
	c.init = function() {
		this.logger = this.options.logger, this.getNosOriginUrlReqNum = 0, this.checkNosReqNum = 0, this
			.cmdTaskArray = [], this.timerMap = {}, this.cmdCallbackMap = {}, this.cmdContentMap = {},
			this.initConnect(), this.reset()
	}, c.reset = function() {
		this.resetConnect()
	}, c.setOptions = function(e) {
		var t = this.options,
			n = Object.keys(t),
			r = n.indexOf("account");
		s.verifyCallback(e, ["onconnect", "onerror", "onwillreconnect", "ondisconnect",
				"onloginportschange", "onmyinfo", "onblacklist", "onmutelist", "onfriends",
				"onusers", "onrobots", "onteams", "onSuperTeams", "onsessions",
				"onSessionsWithMoreRoaming", "onStickTopSessions", "onroamingmsgs", "onofflinemsgs",
				"onofflinefiltermsgs", "onroamingsysmsgs", "onofflinesysmsgs",
				"onofflinefiltersysmsgs", "onofflinecustomsysmsgs", "onofflinefiltercustomsysmsgs",
				"onbroadcastmsg", "onbroadcastmsgs", "onsysmsgunread", "onsyncdone",
				"onteammembers", "onsyncteammembersdone", "onmsg", "onsysmsg", "oncustomsysmsg",
				"onupdatemyinfo", "onupdateuser", "onSyncUpdateServerSession",
				"onUpdateSuperTeamMember", "onCreateSuperTeam", "onUpdateSuperTeam",
				"onAddSuperTeamMembers", "onRemoveSuperTeamMembers", "onUpdateSuperTeamManagers",
				"onDismissSuperTeam", "onTransferSuperTeam", "onUpdateSuperTeamMembersMute",
				"onupdateteammember", "onCreateTeam", "onUpdateTeam", "onAddTeamMembers",
				"onRemoveTeamMembers", "onUpdateTeamManagers", "onDismissTeam", "onTransferTeam",
				"onUpdateTeamMembersMute", "onTeamMsgReceipt", "onupdatesession", "onQuickComment",
				"onDeleteQuickComment", "onPinMsgChange", "onupdatesysmsgunread", "onupdatesysmsg",
				"onsynccreateteam", "onsyncsupercreateteam", "onsyncmarkinblacklist",
				"onsyncmarkinmutelist", "onsyncfriendaction", "shouldIgnoreNotification",
				"shouldIgnoreMsg", "onDeleteMsgSelf", "shouldCountNotifyUnread",
				"onPushNotificationMultiportConfig", "onPushNotificationMultiportConfigUpdate",
				"onpushevents"
			], "protocol::IMProtocol"), this.logger.info("setOptions::", s.omitAsString(e, ["appKey",
				"token", "loginExt", "customTag"
			])), -1 !== r && n.splice(r, 1), e = s.filterObj(e, n), this.options = s.merge(t, e), this
			.reset()
	}, c.sendCmd = function(e, t = "", n) {
		this.heartbeat();
		var s, r = e,
			i = (e = this.parser.createCmd(e, t)).SER;
		t = t || {}, this.cmdContentMap[i] = t, t.single && (delete t.single, 1 === (s = Object.keys(t))
				.length && (this.cmdContentMap[i] = t[s[0]])), t.NOTSTORE && ((s = t.NOTSTORE.split(
				" ")).forEach((function(e) {
				delete t[e]
			})), delete t.NOTSTORE), (n = n || t.callback) && (this.cmdCallbackMap[i] = n), this
			.cmdTaskArray.push({
				cmdName: r,
				cmd: JSON.stringify(e)
			}), this.startCmdTaskTimer()
	}, c.startCmdTaskTimer = function() {
		var e = this;
		e.cmdTaskTimer || (e.cmdTaskTimer = setTimeout((function() {
			var t = e.cmdTaskArray.shift();
			e.cmdTaskTimer = null, t && e.executeCmdTask(t), e.cmdTaskArray.length && e
				.startCmdTaskTimer()
		}), 0))
	}, c.executeCmdTask = function(e) {
		var t = e.cmdName,
			n = e.cmd,
			s = (n = JSON.parse(n)).SER;
		this.isFrequencyControlled(t) ? (this.logger.warn(
			`protocol::executeCmdTask: ${t} hit freq control`), this.markCallbackInvalid(s, o
			.newFrequencyControlError({
				callFunc: "protocol::executeCmdTask",
				message: t + " hit freq control"
			}))) : this.hasLogin ? ("heartbeat" !== t && this.logger.log("protocol::sendCmd: " + t),
			this.doSendCmd(n)) : "login" === t && this.isConnected() ? (this.logger.info(
			"protocol::sendCmd: " + t), this.doSendCmd(n)) : (this.logger.warn(
			`protocol::executeCmdTask: ${t} not connected or login`), this.markCallbackInvalid(
			s, o.newSocketStateError({
				callFunc: "protocol::executeCmdTask",
				message: t + " not connected or not login"
			})))
	}, c.isFrequencyControlled = function(e) {
		var t = this.frequencyControlMap && this.frequencyControlMap[e];
		if (t) {
			if (Date.now() < t.from + t.duration) return !0;
			delete this.frequencyControlMap[e]
		}
	}, c.doSendCmd = function(e) {
		var t = this,
			n = e.SER,
			s = 0 === n ? r.hbCmdTimeout : r.cmdTimeout;

		function i() {
			t.markCallbackInvalid(n, o.newSocketStateError({
				callFunc: "protocol::doSendCmd",
				message: `ser ${n} socketSendJson Error`
			})), t.onDisconnect("protocol::doSendCmd:socketSendJson")
		}
		t.timerMap[n] = setTimeout((function() {
			t.markCallbackInvalid(n, o.newTimeoutError({
				callFunc: "protocol::doSendCmd",
				message: `ser ${n} Timeout Error`
			}))
		}), s);
		try {
			t.socket && t.socket.send ? t.socket.send(JSON.stringify(e)) : i()
		} catch (e) {
			i()
		}
	}, c.getObjWithSer = function(e) {
		var t = this.cmdContentMap[e];
		return t && !t.isImSyncDataObj && delete this.cmdContentMap[e], t && s.copy(t)
	}, c.getCallbackWithSer = function(e) {
		var t = this.cmdCallbackMap[e];
		return t && !t.isImSyncDataCb && delete this.cmdCallbackMap[e], t
	}, c.getTimerWithSer = function(e) {
		var t = this.timerMap[e];
		return delete this.timerMap[e], t
	}, c.clearTimerWithSer = function(e) {
		var t = this.getTimerWithSer(e);
		t && clearTimeout(t)
	}, c.markCallbackInvalid = function(e, t) {
		this.getObjWithSer(e), this.clearTimerWithSer(e);
		var n = this.getCallbackWithSer(e);
		if (n) {
			var s = n.options;
			setTimeout((function() {
				n(t || o.newUnknownError({
					ser: e
				}), s)
			}), 0)
		}
	}, c.markAllCallbackInvalid = function(e) {
		var t = this;
		Object.keys(this.cmdCallbackMap).forEach((function(n) {
			t.markCallbackInvalid(n, e)
		})), t.cmdTaskArray = []
	}, c.getPacketObj = function(e) {
		let t = null;
		if (e && e.raw) {
			var n = e.raw.ser;
			s.notundef(n) && (t = this.getObjWithSer(n))
		}
		return t
	}, c.callPacketAckCallback = function(e) {
		var t = this;
		if (e && e.raw) {
			var n = e.raw.ser;
			if (s.notundef(n)) {
				t.clearTimerWithSer(n);
				var r = t.getCallbackWithSer(n);
				r && (r.originUrl && e.obj && e.obj.file && (e.obj.file._url_safe = e.obj.file.url, e
					.obj.file.url = r.originUrl, "audio" === e.obj.type && (e.obj.file.mp3Url =
						r.originUrl + (~r.originUrl.indexOf("?") ? "&" : "?") +
						"audioTrans&type=mp3")), e.promise ? e.promise.then((function() {
					r(e.error, e.obj)
				}), (function(s) {
					s.callFunc = "protocol::callPacketAckCallback", s.message =
						`Resp Promoise Error: cmd: ${e.cmd}, ser: ${n}`;
					var i = o.customError("CALLBACK_ACK_ERR", s);
					t.logger.error("protocol::callPacketAckCallback: promise error " +
						JSON.stringify(s)), r(i, e.obj, e.content)
				})) : r(e.error, e.obj, e.content))
			}
		}
	}, c.onMessage = function(e) {
		var t = this;
		t.heartbeat(), t.parser.parseResponse(e).then((function(e) {
			if (e.notFound && t.logger.warn("protocol::onMessage: packet not found " + JSON
					.stringify(e)), e.error) {
				e.error.message = `${e.cmd} error: ${e.error.message}`, t.logger.error(
					`protocol::onMessage: packet error ${JSON.stringify(e.error)}，raw cmd ${e.rawStr}`
					);
				var n = e.raw || {};
				408 !== n.code && 415 !== n.code && 500 !== n.code || i.saveErrEvent({
					code: n.code,
					module: e.cmd,
					accid: t.account
				})
			}
			e.frequencyControlDuration && (t.logger.error(
					"protocol::onMessage: server freq control " + JSON.stringify(e.cmd)
					), t.frequencyControlMap = t.frequencyControlMap || {}, t
				.frequencyControlMap[e.cmd] = {
					from: +new Date,
					duration: e.frequencyControlDuration
				}), e.obj = t.getPacketObj(e), "heartbeat" !== e.cmd && t.logger.log(
				"protocol::recvCmd: " + e.cmd);
			var r = "process" + s.capFirstLetter(e.service);
			if (t[r])
				if ("syncDone" === e.cmd) {
					if (t.cmdCallbackMap[e.raw.ser] && t.cmdCallbackMap[e.raw.ser]
						.isImSyncDataCb) {
						t.cmdCallbackMap[e.raw.ser].isImSyncDataCb = !1;
						var o = function(e, t) {
							this.checkNosReqNum++, this.getNosOriginUrlReqNum <= 0 ||
								this.checkNosReqNum >= 20 ? this[e](t) : setTimeout(o,
									300)
						}.bind(t, r, e);
						setTimeout((function() {
							o.call(t, r, e)
						}), 10)
					}
				} else t[r](e);
			else t.logger.warn(`protocol::onMessage: ${r} not found`);
			t.callPacketAckCallback(e)
		}))
	}, c.onMiscError = function(e, t, n) {
		t && this.notifyError(e, t, n)
	}, c.onCustomError = function(e, t) {
		var n = o.customError(e, t);
		let s = t.message || "未知错误";
		this.onMiscError(s, n)
	}, c.notifyError = function(e, t, n) {
		this.isConnected() && (this.logger.error(`${e||""} ${this.name}`, t, n), this.options.onerror(t,
			n))
	}, c.emitAPI = function({
		type: e,
		obj: t
	}) {
		this.api.emit(e, t)
	}, e.exports = a, n(81), n(84), n(85), n(86), n(87)
}, , function(e, t) {
	var n;
	n = function() {
		return this
	}();
	try {
		n = n || new Function("return this")()
	} catch (e) {
		"object" == typeof window && (n = window)
	}
	e.exports = n
}, function(e, t, n) {
	var s = n(0),
		r = s.undef,
		i = s.notundef,
		o = s.exist,
		a = n(26),
		c = n(47),
		m = {
			p2p: 0,
			team: 1,
			superTeam: 5
		},
		u = {
			0: "p2p",
			1: "team",
			5: "superTeam"
		},
		l = Object.keys(m),
		d = c.typeMap,
		p = c.validTypes;

	function g(e) {
		s.verifyOptions(e, "scene to type", "msg::Message"), s.verifyParamValid("scene", e.scene, l,
			"msg::Message");
		this.scene = m[e.scene], this.to = "" + e.to, this.type = d[e.type], this.resend = e.resend ? 1 : 0,
			e.resend ? (s.verifyOptions(e, "idClient", "msg::Message"), this.idClient = e.idClient) : this
			.idClient = s.guid(), i(e.subType) && (s.isInt(+e.subType) && +e.subType > 0 ? this.subType = +e
				.subType : s.onParamError("subType只能是大于0的整数", "msg::Message"));
		let t = e.replyMsg;
		t && t.idServer && t.from && t.to && t.time && (this.replyMsgFromAccount = t.from, this
				.replyMsgToAccount = t.to, this.replyMsgTime = t.time, this.replyMsgIdServer = t.idServer,
				this.replyMsgIdClient = t.idClient, t.threadMsgFromAccount && t.threadMsgIdServer && t
				.threadMsgTime && t.threadMsgToAccount ? (this.threadMsgFromAccount = t
					.threadMsgFromAccount, this.threadMsgToAccount = t.threadMsgToAccount, this
					.threadMsgTime = t.threadMsgTime, this.threadMsgIdServer = t.threadMsgIdServer, this
					.threadMsgIdClient = t.threadMsgIdClient) : (this.threadMsgFromAccount = t.from, this
					.threadMsgToAccount = t.to, this.threadMsgTime = t.time, this.threadMsgIdServer = t
					.idServer, this.threadMsgIdClient = t.idClient)), i(e.text) && (this.body = "" + e
			.text), i(e.custom) && ("object" == typeof e.custom ? this.custom = JSON.stringify(e.custom) :
				this.custom = "" + e.custom), i(e.body) && (this.body = "" + e.body), i(e.pushContent) && (
				this.pushContent = "" + e.pushContent), i(e.pushPayload) && (this.pushPayload = "" + e
				.pushPayload);
		var n = e.apns;
		if (i(n) && "team" === e.scene) {
			var r = n.accounts;
			i(r) && s.verifyParamType("apns.accounts", r, "array", "msg::Message"), this.apnsAccounts = r ?
				JSON.stringify(r) : "#%@all@%#", this.apnsContent = n.content || e.pushContent || "", s
				.verifyBooleanWithDefault(n, "forcePush", !0, "options.apns", "msg::Message"), this
				.apnsForcePush = n.forcePush ? 1 : 0
		}
		i(e.isHistoryable) && (this.isHistoryable = e.isHistoryable ? 1 : 0), i(e.isRoamingable) && (this
				.isRoamingable = e.isRoamingable ? 1 : 0), i(e.isSyncable) && (this.isSyncable = e
				.isSyncable ? 1 : 0), i(e.cc) && (this.cc = e.cc ? 1 : 0), i(e.env) && (this.env = e.env),
			i(e.isPushable) && (this.isPushable = e.isPushable ? 1 : 0), i(e.isOfflinable) && (this
				.isOfflinable = e.isOfflinable ? 1 : 0), i(e.isUnreadable) && (this.isUnreadable = e
				.isUnreadable ? 1 : 0), i(e.needPushNick) && (this.needPushNick = e.needPushNick ? 1 : 0),
			i(e.needMsgReceipt) && (this.needMsgReceipt = e.needMsgReceipt ? 1 : 0), i(e.yidunEnable) && (
				this.yidunEnable = e.yidunEnable ? 1 : 0), i(e.needUpdateSession) && (this
				.needUpdateSession = !1 === e.needUpdateSession ? 0 : 1), i(e.antiSpamUsingYidun) && (this
				.antiSpamUsingYidun = e.antiSpamUsingYidun ? 1 : 0), i(e.clientAntiSpam) && (this
				.clientAntiSpam = e.clientAntiSpam ? 1 : 0), i(e.antiSpamContent) && ("object" == typeof e
				.antiSpamContent ? this.antiSpamContent = JSON.stringify(e.antiSpamContent) : this
				.antiSpamContent = "" + e.antiSpamContent), i(e.antiSpamBusinessId) && ("object" == typeof e
				.antiSpamBusinessId ? this.antiSpamBusinessId = JSON.stringify(e.antiSpamBusinessId) : this
				.antiSpamBusinessId = "" + e.antiSpamBusinessId), i(e.yidunAntiCheating) && (this
				.yidunAntiCheating = e.yidunAntiCheating), i(e.yidunAntiSpamExt) && (this.yidunAntiSpamExt =
				e.yidunAntiSpamExt)
	}
	s.merge(g.prototype, c.prototype), g.prototype.getScene = function() {
		return u[this.scene]
	}, g.getType = c.getType, g.reverse = function(e) {
		var t, n = u[e.scene];
		if (t = "1" === e.delete ? {
				delete: !0,
				scene: n || e.scene,
				from: e.from,
				time: +e.time,
				to: "" + e.to
			} : {
				scene: n || e.scene,
				from: e.from,
				fromNick: e.fromNick,
				fromClientType: a.reverseType(e.fromClientType),
				fromDeviceId: e.fromDeviceId,
				to: "" + e.to,
				time: +e.time,
				type: g.getType(e),
				text: o(e.body) ? e.body : e.text || "",
				isHistoryable: r(e.isHistoryable) || 1 == +e.isHistoryable,
				isRoamingable: r(e.isRoamingable) || 1 == +e.isRoamingable,
				isSyncable: r(e.isSyncable) || 1 == +e.isSyncable,
				cc: r(e.cc) || 1 == +e.cc,
				isPushable: r(e.isPushable) || 1 == +e.isPushable,
				isOfflinable: r(e.isOfflinable) || 1 == +e.isOfflinable,
				isUnreadable: r(e.isUnreadable) || 1 == +e.isUnreadable,
				isReplyMsg: r(e.isReplyMsg) || 1 == +e.isReplyMsg,
				needPushNick: r(e.needPushNick) || 1 == +e.needPushNick,
				needMsgReceipt: 1 == +e.needMsgReceipt,
				isLocal: !1
			}, e.isInBlackList && (t.isInBlackList = 1 == +e.isInBlackList, t.isInBlackList && (e
				.status = "fail")), i(e.isMuted) && (t.isMuted = 1 == +e.isMuted), i(e.resend) && (t
				.resend = 1 == +e.resend), i(e.idClient) && (t.idClient = e.idClient), i(e.idServer) &&
			(t.idServer = "" + e.idServer), i(e.userUpdateTime) && (t.userUpdateTime = +e
				.userUpdateTime), i(e.custom) && (t.custom = e.custom), i(e.callbackExt) && (t
				.callbackExt = e.callbackExt), i(e.subType) && (t.subType = +e.subType), i(e
				.pushContent) && (t.pushContent = e.pushContent), i(e.pushPayload) && (t.pushPayload = e
				.pushPayload), i(e.tempTeamMemberCount) && (t.tempTeamMemberCount = +e
				.tempTeamMemberCount), i(e.yidunAntiSpamRes) && (t.yidunAntiSpamRes = e
				.yidunAntiSpamRes), i(e.apnsAccounts)) {
			if (t.apns = {}, "#%@all@%#" !== e.apnsAccounts) {
				var s = e.apnsAccounts;
				try {
					t.apns.accounts = JSON.parse(s)
				} catch (e) {
					t.apns.accounts = []
				}
			}
			t.apns.content = e.apnsContent || "", t.apns.forcePush = 1 == +e.apnsForcePush
		}
		if (t.status = e.status || "success", i(e.filter) && (t.filter = e.filter), e
			.replyMsgIdServer && e.threadMsgIdServer) {
			["replyMsgFromAccount", "replyMsgToAccount", "replyMsgTime", "replyMsgIdServer",
				"replyMsgIdClient", "threadMsgFromAccount", "threadMsgToAccount", "threadMsgTime",
				"threadMsgIdServer", "threadMsgIdClient"
			].forEach(n => {
				t[n] = e[n]
			}), t.replyMsgTime = +t.replyMsgTime, t.threadMsgTime = +t.threadMsgTime
		}
		return t
	}, g.setExtra = function(e, t) {
		e.target = g.getMsgTarget(e, t), e.sessionId = e.scene + "-" + e.target, c.setFlow(e, t)
	}, g.getMsgTarget = function(e, t) {
		return "p2p" === e.scene ? e.to === t ? e.from : e.to : "team" === e.scene || "superTeam" === e
			.scene ? e.to : void 0
	}, g.deduplication = function(e) {
		var t, n = {},
			s = [];
		return e.forEach((function(e) {
			t = e.idClient, n[t] || (n[t] = !0, s.push(e))
		})), s
	}, g.sortMsgs = function(e) {
		return e = e.slice(0), s.sortObjArray(e, {
			sortPath: "time"
		}), e
	}, g.getLastMsg = function(e) {
		return (e = g.sortMsgs(e))[e.length - 1]
	}, g.getLastNotIgnoredMsg = function(e) {
		for (var t = null, n = (e = g.sortMsgs(e)).length - 1; n >= 0; n--)
			if (!(t = e[n]).ignore) return t;
		return null
	}, g.getMaxTimetag = function(e) {
		return g.getLastMsg(e).time
	}, g.validScenes = l, g.validTypes = p, g.sceneMap = m, g.sceneReverseMap = u, e.exports = g
}, function(e, t, n) {
	const s = n(1),
		r = {
			genUrlSep: e => -1 === (e = "" + e).indexOf("?") ? "?imageView&" : "&",
			urlQuery2Object(e) {
				if ("[object String]" !== Object.prototype.toString.call(e) || "" === e) return {};
				var t = e.indexOf("?");
				if (-1 !== t) {
					var n = e.slice(t + 1).split("&"),
						s = {};
					return n.forEach(e => {
						if (~e.indexOf("=")) {
							let t = e.split("=");
							s[t[0]] = decodeURIComponent(t[1])
						} else s[e] = ""
					}), s
				}
			},
			url2object(e) {
				"[object String]" !== Object.prototype.toString.call(e) && (e = "");
				let t = (e = e || "").indexOf("https") >= 0 ? "https://" : "http://",
					n = e.replace(t, "");
				n.indexOf("?") >= 0 && (n = n.substring(0, n.indexOf("?")));
				let s = n.split("/");
				n = s[0];
				let r = "";
				if (s.length > 0 && (r = s.slice(1).join("/")), -1 === e.indexOf("?")) return {
					protocol: t,
					hostname: n,
					path: r,
					query: {}
				}; {
					let s = e.substr(e.indexOf("?") + 1).split("&"),
						i = {};
					return s.forEach(e => {
						if (e.indexOf("=") > 0) {
							let t = e.split("=");
							i[t[0]] = decodeURIComponent(t[1])
						} else i[e] = ""
					}), {
						protocol: t,
						hostname: n,
						path: r,
						query: i
					}
				}
			},
			object2url(e) {
				let {
					protocol: t,
					hostname: n,
					path: s,
					query: r
				} = e;
				t = t || "http://", n = n || "", s && (n = `${n}/${s}`), r = r || {};
				let i = [];
				for (let e in r) "imageView" !== e && i.push(`${e}=${encodeURIComponent(r[e])}`);
				return i.length > 0 ? `${t}${n}?imageView&${i.join("&")}` : `${t}${n}`
			},
			genPrivateUrl(e) {
				const t = r.url2object(e),
					{
						hostname: n,
						path: i
					} = t,
					{
						downloadUrl: o,
						downloadHostList: a,
						nosCdnEnable: c
					} = s,
					m = s.serverNosConfig.cdnDomain,
					u = decodeURIComponent(s.serverNosConfig.objectPrefix),
					l = decodeURIComponent(i),
					d = l.indexOf(u);
				if (m && d > -1 && c) return `${t.protocol}${m}/${l.slice(d)}`;
				if (a.includes(n) && i.includes("/")) {
					let e = i.indexOf("/"),
						t = i.substring(0, e),
						n = i.substring(e + 1);
					return o.replace("{bucket}", t).replace("{object}", n)
				}
				let p = a.filter(e => "string" == typeof n && n.includes(e))[0],
					g = p ? n.replace(p, "").replace(/\W/g, "") : null;
				return g ? o.replace("{bucket}", g).replace("{object}", i) : e
			}
		};
	e.exports = r
}, , function(e, t, n) {
	var s = n(6),
		r = n(65),
		i = n(67),
		o = n(68),
		a = {},
		c = s.f;

	function m(e) {
		var t = e.upload = "multipart/form-data" === (e.headers || s.o)["Content-Type"],
			n = !1;
		try {
			n = (location.protocol + "//" + location.host).toLowerCase() !== s.url2origin(e.url)
		} catch (e) {}
		return e.cors = n, t || n || e.mode ? function(e) {
			var t = e.mode,
				n = r,
				a = s.getGlobal();
			return !a.FormData && a.document && (t = "iframe"), "iframe" === t && (n = e.upload ? i :
				o), new n(e)
		}(e) : new r(e)
	}

	function u(e, t, n) {
		var s = a[e];
		if (s) {
			"onload" === t && s.result && (n = function(e, t) {
					t = {
						data: t
					};
					var n = e.result.headers;
					return n && (t.headers = e.req.header(n)), t
				}(s, n)),
				function(e) {
					var t = a[e];
					t && (t.req.destroy(), delete a[e])
				}(e);
			var r = {
				type: t,
				result: n
			};
			c(r), r.stopped || s[t](r.result)
		}
	}

	function l(e, t) {
		u(e, "onload", t)
	}

	function d(e, t) {
		u(e, "onerror", t)
	}

	function p(e, t) {
		var n = s.genUrlSep(e);
		return t = t || "", s.isObject(t) && (t = s.object2query(t)), t && (e += n + t), e
	}

	function g(e, t) {
		t = t || {};
		var n = s.uniqueID(),
			r = {
				result: t.result,
				onload: t.onload || s.f,
				onerror: t.onerror || s.f
			};
		a[n] = r, t.onload = l.bind(null, n), t.onerror = d.bind(null, n), t.query && (e = p(e, t.query));
		var i = t.method || "";
		return i && !/get/i.test(i) || !t.data || (e = p(e, t.data), t.data = null), t.url = e, r.req = m(
			t), n
	}
	g.filter = function(e) {
		s.isFunction(e) && (c = e)
	}, g.abort = function(e) {
		var t = a[e];
		t && t.req && t.req.abort()
	}, e.exports = g
}, function(e, t, n) {
	const {
		urlQuery2Object: s
	} = n(16);
	var r, i = n(0),
		o = n(4),
		a = n(52),
		c = n(88),
		m = n(89),
		u = n(90),
		l = n(91),
		d = n(92);

	function p(e) {
		this.mixin(e)
	}
	p.prototype = Object.create(function() {}.prototype, {
		protocol: {
			value: null,
			writable: !0,
			enumerable: !0,
			configurable: !0
		}
	}), p.prototype.setProtocol = function(e) {
		this.protocol = e
	}, p.prototype.mixin = function(e) {
		this.configMap = this.configMap || {}, ["idMap", "cmdConfig", "packetConfig"].forEach(t => {
			this.configMap[t] = i.merge({}, this.configMap[t], e.configMap && e.configMap[t])
		}), ["serializeMap", "unserializeMap"].forEach(t => {
			this[t] = i.merge({}, this[t], e[t])
		})
	}, p.prototype.createCmd = (r = 1, function(e, t) {
		var n = this,
			s = this.configMap.cmdConfig[e],
			o = "heartbeat" === e ? 0 : r++;
		return o > 32767 && (o = 1, r = 2), e = {
			SID: s.sid,
			CID: s.cid,
			SER: o
		}, s.params && (e.Q = [], s.params.forEach((function(s) {
			var r = s.type,
				o = s.name,
				a = s.entity,
				c = t[o];
			if (!i.undef(c)) {
				switch (r) {
					case "PropertyArray":
						r = "ArrayMable", c = c.map((function(e) {
							return {
								t: "Property",
								v: n.serialize(e, a)
							}
						}));
						break;
					case "Property":
						c = n.serialize(c, o);
						break;
					case "bool":
						c = c ? "true" : "false"
				}
				e.Q.push({
					t: r,
					v: c
				})
			}
		}))), e
	}), p.prototype.parseResponse = function(e) {
		var t = this;
		return new Promise((n, s) => {
			var r = JSON.parse(e),
				a = {
					raw: r,
					rawStr: e,
					error: o.genError(r.code)
				},
				c = t.configMap.packetConfig[r.sid + "_" + r.cid];
			if (!c) return a.notFound = {
				sid: r.sid,
				cid: r.cid
			}, void n(a);
			var m = r.r,
				u = "notify" === c.service && !c.cmd;
			if (a.isNotify = u, u) {
				var l = r.r[1].headerPacket;
				if (c = t.configMap.packetConfig[l.sid + "_" + l.cid], m = r.r[1].body, !c)
					return a.notFound = {
						sid: l.sid,
						cid: l.cid
					}, void n(a)
			}
			if (a.service = c.service, a.cmd = c.cmd, a.error) {
				let e = `${r.sid}_${r.cid}`;
				if (u && (e = `${l.sid}_${l.cid}`), a.error.cmd = a.cmd, a.error.callFunc =
					"protocol::parseResponse: " + e, 416 === a.error.code) {
					var d = m[0];
					d && (a.frequencyControlDuration = 1e3 * d)
				}
			}
			var p = !1;
			a.error && c.trivialErrorCodes && (p = -1 !== c.trivialErrorCodes.indexOf(a.error
				.code));
			var g = [];
			if ((!a.error || p) && c.response) {
				a.content = {};
				var f = function(e, t, n, s) {
					if (e && "msg" === s || "sysMsg" === s) {
						var r = n.content[s];
						i.isObject(r) && !r.idServer && (r.idServer = "" + t.r[0])
					}
				};
				c.response.forEach((function(e, n) {
					var s = m[n];
					if (!i.undef(s)) {
						var o = e.type,
							c = e.name,
							l = e.entity || c;
						switch (o) {
							case "Property":
								g.push(t.unserialize(s, l).then(function(e, t, n, s,
									r) {
									n.content[s] = r, f(e, t, n, s)
								}.bind(this, u, r, a, c)));
								break;
							case "PropertyArray":
								a.content[c] = [], s.forEach((function(e, n) {
									g.push(t.unserialize(e, l).then(
										function(e, t, s) {
											e.content[t][n] = s
										}.bind(this, a, c)))
								}));
								break;
							case "KVArray":
								a.content[c] = s, f(u, r, a, c);
								break;
							case "long":
							case "Long":
							case "byte":
							case "Byte":
							case "Number":
								a.content[c] = +s;
								break;
							default:
								a.content[c] = s, f(u, r, a, c)
						}
					}
				}))
			}
			Promise.all(g).then((function() {
				n(a)
			}))
		})
	}, p.prototype.serialize = function(e, t) {
		var n = this.serializeMap[t],
			s = {};
		for (var r in n) e.hasOwnProperty(r) && (s[n[r]] = e[r]);
		return s
	}, p.prototype.matchNosSafeUrl = function(e) {
		if (!i.isString(e) || !~e.indexOf("_im_url=1")) return !1;
		var t = s(e);
		return !(!t || !t._im_url || 1 != t._im_url)
	}, p.prototype.getOneNosOriginUrl = function(e, t, n) {
		var s = this;
		return new Promise((r, i) => {
			s.protocol.getNosOriginUrlReqNum++, s.protocol.sendCmd("getNosOriginUrl", {
				nosFileUrlTag: {
					safeUrl: e
				}
			}, (function(e, i, o) {
				s.protocol.getNosOriginUrlReqNum--, e ? s.protocol.logger.warn(
					"error: get nos originUrl failed", e) : (t["_" + n +
						"_safe"] = t[n], t[n] = o.nosFileUrlTag && o
					.nosFileUrlTag.originUrl), r()
			}))
		})
	}, p.prototype.checkObjSafeUrl = function(e, t, n) {
		for (var s in e)
			if (e.hasOwnProperty(s)) {
				var r = e[s];
				if (i.isString(r)) {
					if (this.matchNosSafeUrl(r)) {
						var o = this.getOneNosOriginUrl(r, e, s);
						t.push(o), n.push(o)
					}
				} else i.isObject(r) ? this.checkObjSafeUrl(r, t, n) : i.isArray(r) && r.forEach(e => {
					i.isObject(e) && this.checkObjSafeUrl(e, t, n)
				})
			}
	};
	var g = ["url", "avatar", "fromAvatar", "chatroomAvatar"];
	p.prototype.unserialize = function(e, t) {
		var n = this;
		return new Promise((function(s, r) {
			var i = n.unserializeMap[t],
				o = {},
				a = [];
			if (e)
				for (var c in i) {
					var m = [];
					if (e.hasOwnProperty(c) && (o[i[c]] = e[c], !n.protocol.keepNosSafeUrl))
						if ("attach" === i[c] && e[c] && e[c].indexOf && ~e[c].indexOf(
								"_im_url=1")) try {
							var u = JSON.parse(e[c]);
							n.checkObjSafeUrl(u, m, a), Promise.all(m).then(function(e,
								t) {
								e.attach = JSON.stringify(t)
							}.bind(n, o, u))
						} catch (e) {
							n.logger.warn("unserialize", e && e.message)
						} else ~g.indexOf(i[c]) && e[c] && n.matchNosSafeUrl(e[c]) && a
							.push(n.getOneNosOriginUrl(e[c], o, i[c]))
				}
			Promise.all(a).then((function(e) {
				s(o)
			}))
		}))
	}, p.prototype.syncUnserialize = function(e, t) {
		var n = this.unserializeMap[t],
			s = {};
		if (e)
			for (var r in n) e.hasOwnProperty(r) && (s[n[r]] = e[r]);
		return s
	};
	const f = new p({
			configMap: a,
			serializeMap: c,
			unserializeMap: m
		}),
		h = new p({
			configMap: u,
			serializeMap: l,
			unserializeMap: d
		});
	e.exports = {
		IM: f,
		Chatroom: h
	}
}, function(e, t, n) {
	var s = n(0),
		r = s.notundef,
		i = s.fillPropertyWithDefault,
		o = {
			0: "normal",
			1: "owner",
			2: "manager"
		};

	function a(e) {
		s.verifyOptions(e, "teamId", "team::TeamMember"), s.verifyParamAtLeastPresentOne(e,
				"nickInTeam muteTeam muteNotiType custom", "team::TeamMember"), this.teamId = e.teamId, r(e
				.account) && (this.account = e.account), r(e.nickInTeam) && (this.nickInTeam = e
			.nickInTeam), r(e.muteNotiType) ? this.bits = e.muteNotiType : r(e.muteTeam) && (this.bits = 0,
				e.muteTeam && (this.bits += 1)), r(e.mute) && (this.mute = e.mute ? 1 : 0), r(e.custom) && (
				this.custom = "" + e.custom)
	}
	a.reverse = function(e) {
		var t = s.copy(e);
		if (r(t.teamId) && (t.teamId = "" + t.teamId), r(t.type) && (t.type = o[t.type]), r(t.active) &&
			(t.active = 1 == +t.active), r(t.valid) && (t.valid = 1 == +t.valid), r(t.mute) && (t.mute =
				1 == +t.mute), r(t.joinTime) && (t.joinTime = +t.joinTime), r(t.updateTime) && (t
				.updateTime = +t.updateTime), r(t.bits)) {
			var n = t.bits;
			delete t.bits, t.muteTeam = !!(1 & n), t.muteNotiType = n
		}
		return r(t.teamId) && r(t.account) && (t.id = a.genId(t.teamId, t.account)), t
	}, a.reverseMembers = function(e) {
		return e.map((function(e) {
			return a.reverse(e)
		}))
	}, a.fillProperties = function(e) {
		var t = i(e, "mute", !1),
			n = i(e, "custom", "");
		return t || n
	}, a.genId = function(e, t) {
		return e + "-" + t
	}, a.accounts2ids = function(e, t) {
		return t.map((function(t) {
			return a.genId(e, t)
		}))
	}, a.assembleMembers = function(e, t) {
		return s.isArray(t) || (t = [t]), t.map((function(t) {
			return a.assembleMember(e, t)
		}))
	}, a.assembleMember = function(e, t) {
		return {
			id: a.genId(e.teamId, t),
			account: t,
			teamId: e.teamId,
			type: "normal",
			nickInTeam: "",
			muteTeam: !1,
			mute: !1,
			joinTime: e.memberUpdateTime,
			updateTime: e.memberUpdateTime,
			active: !0,
			valid: !0,
			invitorAccid: ""
		}
	}, a.assembleOwner = function(e) {
		var t = a.assembleMember(e, e.owner);
		return t.type = "owner", t
	}, e.exports = a
}, function(e, t, n) {
	var s = n(0),
		r = s.undef,
		i = s.notundef,
		o = n(19).IM,
		a = n(25),
		c = n(20),
		m = {
			customP2p: 100,
			customTeam: 101,
			customSuperTeam: 103,
			deleteMsgP2p: 7,
			deleteMsgTeam: 8,
			deleteMsgSuperTeam: 12,
			deleteOnewayMsgP2p: 13,
			deleteOnewayMsgTeam: 14
		},
		u = {
			0: "applyTeam",
			1: "rejectTeamApply",
			2: "teamInvite",
			3: "rejectTeamInvite",
			5: "friendRequest",
			6: "deleteFriend",
			7: "deleteMsgP2p",
			8: "deleteMsgTeam",
			12: "deleteMsgSuperTeam",
			13: "deleteMsgP2pOneWay",
			14: "deleteMsgTeamOneWay",
			15: "applySuperTeam",
			16: "rejectSuperTeamApply",
			17: "superTeamInvite",
			18: "rejectSuperTeamInvite",
			100: "customP2p",
			101: "customTeam",
			103: "customSuperTeam",
			102: "customP2p"
		},
		l = {
			1: "addFriend",
			2: "applyFriend",
			3: "passFriendApply",
			4: "rejectFriendApply"
		},
		d = ["team", "superTeam", "friend", "msg"],
		p = {
			applyTeam: "team",
			rejectTeamApply: "team",
			teamInvite: "team",
			rejectTeamInvite: "team",
			applySuperTeam: "superTeam",
			rejectSuperTeamApply: "superTeam",
			superTeamInvite: "superTeam",
			rejectSuperTeamInvite: "superTeam",
			addFriend: "friend",
			applyFriend: "friend",
			passFriendApply: "friend",
			rejectFriendApply: "friend",
			deleteFriend: "friend",
			deleteMsg: "msg"
		};

	function g(e) {
		s.verifyOptions(e, "type to", "sysmsg::SystemMessage"), s.verifyParamValid("type", e.type, g
				.validTypes, "sysmsg::SystemMessage"), -1 !== e.type.indexOf("custom") && (s.verifyOptions(
					e, "content", "sysmsg::SystemMessage"), this.attach = e.content, i(e.apnsText) && (this
					.apnsText = "" + e.apnsText), i(e.pushPayload) && ("object" == typeof e.pushPayload ?
					this.pushPayload = JSON.stringify(e.pushPayload) : this.pushPayload = "" + e.pushPayload
					), i(e.sendToOnlineUsersOnly) && (this.sendToOnlineUsersOnly = e.sendToOnlineUsersOnly ?
					0 : 1), i(e.cc) && (this.cc = e.cc ? 1 : 0), i(e.isPushable) && (this.isPushable = e
					.isPushable ? 1 : 0), i(e.isUnreadable) && (this.isUnreadable = e.isUnreadable ? 1 : 0),
				i(e.needPushNick) && (this.needPushNick = e.needPushNick ? 1 : 0)), 0 === e.type.indexOf(
				"deleteMsg") && (e.apnsText && (this.apnsText = e.apnsText), e.pushPayload && (this
				.pushPayload = e.pushPayload), e.attach && (this.attach = e.attach)), this.time = e.time ||
			+new Date, this.type = m[e.type], this.to = e.to, i(e.from) && (this.from = e.from), i(e.ps) &&
			(this.ps = e.ps), i(e.deletedIdClient) && (this.deletedIdClient = e.deletedIdClient), i(e
				.deletedIdServer) && (this.deletedIdServer = e.deletedIdServer), i(e.opeAccount) && (this
				.opeAccount = e.opeAccount), i(e.yidunEnable) && (this.yidunEnable = e.yidunEnable ? 1 : 0),
			i(e.antiSpamContent) && ("object" == typeof e.antiSpamContent ? this.antiSpamContent = JSON
				.stringify(e.antiSpamContent) : this.antiSpamContent = "" + e.antiSpamContent), i(e
				.antiSpamBusinessId) && ("object" == typeof e.antiSpamBusinessId ? this.antiSpamBusinessId =
				JSON.stringify(e.antiSpamBusinessId) : this.antiSpamBusinessId = "" + e.antiSpamBusinessId),
			i(e.env) && (this.env = e.env), this.idClient = e.idClient || s.guid()
	}
	g.validTypes = Object.keys(m).concat(Object.keys(p)), g.validCategories = ["team", "friend"], g
		.isCustom = function(e) {
			return "custom" === e.type
		}, g.reverse = function(e) {
			var t = {
				time: +e.time,
				to: e.to,
				type: u[e.type]
			};
			if (i(e.from) && (t.from = e.from), i(e.idServer) && (t.idServer = "" + e.idServer), i(e
					.deletedIdClient) && (t.deletedIdClient = e.deletedIdClient), i(e.deletedIdServer) && (t
					.deletedIdServer = "" + e.deletedIdServer), i(e.deletedMsgTime) && (t.deletedMsgTime = +
					e.deletedMsgTime), i(e.deletedMsgFromNick) && (t.deletedMsgFromNick = "" + e
					.deletedMsgFromNick), i(e.opeAccount) && (t.opeAccount = e.opeAccount), i(e.ps) && (t
					.ps = e.ps), i(e.callbackExt) && (t.callbackExt = e.callbackExt), e.attach = e.attach ?
				"" + e.attach : "", "customP2p" === t.type || "customTeam" === t.type ||
				"customSuperTeam" === t.type) t.content = e.attach, i(e.apnsText) && (t.apnsText = e
				.apnsText), i(e.pushPayload) && (t.pushPayload = e.pushPayload), s.merge(t, {
				sendToOnlineUsersOnly: r(e.sendToOnlineUsersOnly) || 0 == +e.sendToOnlineUsersOnly,
				cc: r(e.cc) || 1 == +e.cc,
				isPushable: r(e.isPushable) || 1 == +e.isPushable,
				isUnreadable: r(e.isUnreadable) || 1 == +e.isUnreadable,
				needPushNick: i(e.needPushNick) && 1 == +e.needPushNick
			}), t.scene = t.type.slice(6).toLowerCase(), t.type = "custom";
			else if (0 === t.type.indexOf("deleteMsg")) {
				e.apnsText && (t.apnsText = e.apnsText), e.pushPayload && (t.pushPayload = e.pushPayload), e
					.attach && (t.attach = e.attach);
				let n = t.type.toLowerCase();
				n.indexOf("p2p") > -1 ? t.scene = "p2p" : n.indexOf("superteam") > -1 ? t.scene =
					"superTeam" : n.indexOf("team") > -1 && (t.scene = "team"), t.type = "deleteMsg"
			} else {
				if (e.attach) {
					t.attach = {};
					var n = JSON.parse(e.attach);
					i(n.vt) ? (t.type = l[n.vt], n.serverex && 1 === n.serverex[0] && (t.serverex = n
						.serverex[1]), delete t.attach) : (i(n.tinfo) && (t.attach.team = a.reverse(o
						.syncUnserialize(n.tinfo, "team"))), i(n.tlist) && (t.attach.member = c
						.reverse(o.syncUnserialize(n.tlist, "teamMember"))), i(n.attach) && (t
						.attach.custom = n.attach))
				}
				t.category = p[t.type], t.read = !1, t.state = "init"
			}
			return i(e.cc) && (t.cc = 1 == +e.cc), t.status = e.status || "success", i(e.filter) && (t
				.filter = e.filter), t
		}, g.reverseSysMsgs = function(e, t) {
			var n = (t = t || {}).mapper,
				r = s.isFunction(n);
			return e.map((function(e) {
				return e = g.reverse(e), r && (e = n(e)), e
			}))
		}, g.completeUnread = function(e) {
			var t;
			return e = e || {}, d.forEach((function(t) {
				delete e[t]
			})), Object.keys(p).forEach((function(n) {
				e[n] = e[n] || 0, e[n] < 0 && (e[n] = 0), e[t = p[n]] = e[t] || 0, e[t] = e[t] +
					e[n]
			})), e.total = 0, d.forEach((function(t) {
				e.total += e[t]
			})), e
		}, e.exports = g
}, function(e, t) {
	e.exports = class {
		constructor() {
			this._entries = []
		}
		append(e, t) {
			if ("string" != typeof e) throw new TypeError("FormData name must be a string");
			if ("string" != typeof t && ("object" != typeof t || "string" != typeof t.uri))
			throw new TypeError("FormData value must be a string or { uri: tempFilePath }");
			this._entries.push([e, t])
		}
		set(e, t) {
			const n = this.get(e);
			n ? n[1] = t : this.append(e, t)
		}
		delete(e) {
			this._entries = this._entries.filter(t => t[0] !== e)
		}
		entries() {
			return this._entries
		}
		get(e) {
			return this._entries.find(t => t[0] === e)
		}
		getAll(e) {
			return this._entries.filter(t => t[0] === e)
		}
		has(e) {
			return this._entries.some(t => t[0] === e)
		}
		keys() {
			return this._entries.map(e => e[0])
		}
		values() {
			return this._entries.map(e => e[1])
		}
	}
}, function(e, t, n) {
	var s = n(6),
		r = s.f,
		i = n(66);

	function o(e) {
		e.onload && this.once("load", e.onload), e.onerror && this.once("error", e.onerror), e
			.onbeforesend && this.once("beforesend", e.onbeforesend), e.onaftersend && this.once(
				"aftersend", e.onaftersend);
		var t = (e = this.options = s.fetch({
			method: "GET",
			url: "",
			sync: !1,
			data: null,
			headers: {},
			cookie: !1,
			timeout: 6e4,
			type: "text",
			form: null,
			input: null,
			putFileAtEnd: !1,
			proxyUrl: ""
		}, e)).headers;
		s.notexist(t["Content-Type"]) && (t["Content-Type"] = "application/x-www-form-urlencoded"), this
			.send()
	}
	var a = o.prototype = Object.create(i.prototype);
	a.send = function() {
		var e = this,
			t = e.options;
		setTimeout((function() {
			try {
				try {
					e.emit("beforesend", t)
				} catch (e) {}
				e.doSend()
			} catch (t) {
				e.onError("serverError", "请求失败:" + t.message)
			}
		}), 0)
	}, a.doSend = r, a.afterSend = function() {
		var e = this;
		setTimeout((function() {
			e.emit("aftersend", e.options)
		}), 0)
	}, a.onLoad = function(e) {
		var t = this.options,
			n = e.status,
			s = e.result;
		if ("number" != typeof n || 0 !== n)
			if (0 === ("" + n).indexOf("2")) {
				if ("json" === t.type) try {
					s = JSON.parse(s)
				} catch (e) {
					return void this.onError("parseError", s)
				}
				this.emit("load", s)
			} else this.onError("serverError", "服务器返回异常状态", {
				status: n,
				result: s,
				date: e.date
			});
		else this.onError("netError", "网络错误")
	}, a.onError = function(e, t, n) {
		var r = s.isObject(n) ? n : {};
		r.code = e || "error", r.message = t || "发生错误", this.emit("error", r)
	}, a.onTimeout = function() {
		this.onError("timeout", "请求超时")
	}, a.abort = function() {
		this.onError("abort", "客户端中止")
	}, a.header = function(e) {
		var t = this;
		if (!s.isArray(e)) return t.getResponseHeader(e || "");
		var n = {};
		return e.forEach((function(e) {
			n[e] = t.header(e)
		})), n
	}, a.getResponseHeader = r, a.destroy = r, e.exports = o
}, function(e, t) {
	var n = {
			link: {
				id: 1,
				heartbeat: 2,
				negotiateTransport: 5,
				initTransport: 6
			},
			sync: {
				id: 5,
				sync: 1,
				syncTeamMembers: 2
			},
			misc: {
				id: 6,
				getSimpleNosToken: 1,
				getNosToken: 2,
				notifyUploadLog: 3,
				uploadSdkLogUrl: 4,
				audioToText: 5,
				processImage: 6,
				getNosTokenTrans: 7,
				notifyTransLog: 8,
				fetchFile: 9,
				fetchFileList: 10,
				removeFile: 11,
				getClientAntispam: 17,
				fileQuickTransfer: 18,
				getNosOriginUrl: 22,
				getServerTime: 23,
				getNosAccessToken: 24,
				deleteNosAccessToken: 25,
				getNosCdnHost: 26,
				getGrayscaleConfig: 27,
				getMixStorePolicy: 28,
				getMixStoreToken: 29,
				getBackSourceToken: 30
			},
			avSignal: {
				id: 15,
				signalingCreate: 1,
				signalingDelay: 2,
				signalingClose: 3,
				signalingJoin: 4,
				signalingLeave: 5,
				signalingInvite: 6,
				signalingCancel: 7,
				signalingReject: 8,
				signalingAccept: 9,
				signalingControl: 10,
				signalingNotify: 11,
				signalingMutilClientSyncNotify: 12,
				signalingUnreadMessageSyncNotify: 13,
				signalingChannelsSyncNotify: 14,
				signalingGetChannelInfo: 15
			}
		},
		s = {
			heartbeat: {
				sid: n.link.id,
				cid: n.link.heartbeat
			},
			negotiateTransport: {
				sid: n.link.id,
				cid: n.link.negotiateTransport,
				params: [{
					type: "int",
					name: "sdkVersion"
				}, {
					type: "Property",
					name: "negotiateTransportTag"
				}]
			},
			initTransport: {
				sid: n.link.id,
				cid: n.link.initTransport,
				params: [{
					type: "Property",
					name: "initTransportTag"
				}]
			},
			getGrayscaleConfig: {
				sid: n.misc.id,
				cid: n.misc.getGrayscaleConfig,
				params: [{
					type: "Property",
					name: "providers"
				}]
			},
			getMixStorePolicy: {
				sid: n.misc.id,
				cid: n.misc.getMixStorePolicy,
				params: [{
					type: "LongArray",
					name: "providers"
				}]
			},
			getMixStoreToken: {
				sid: n.misc.id,
				cid: n.misc.getMixStoreToken,
				params: [{
					type: "Property",
					name: "mixTokenReq"
				}]
			},
			getBackSourceToken: {
				sid: n.misc.id,
				cid: n.misc.getBackSourceToken,
				params: [{
					type: "Property",
					name: "mixAuthTokenReq"
				}]
			},
			getSimpleNosToken: {
				sid: n.misc.id,
				cid: n.misc.getSimpleNosToken,
				params: [{
					type: "int",
					name: "num"
				}]
			},
			getNosToken: {
				sid: n.misc.id,
				cid: n.misc.getNosToken,
				params: [{
					type: "String",
					name: "responseBody"
				}, {
					type: "Property",
					name: "nosToken",
					entity: "nosToken"
				}]
			},
			uploadSdkLogUrl: {
				sid: n.misc.id,
				cid: n.misc.uploadSdkLogUrl,
				params: [{
					type: "string",
					name: "url"
				}]
			},
			audioToText: {
				sid: n.misc.id,
				cid: n.misc.audioToText,
				params: [{
					type: "Property",
					name: "audioToText"
				}]
			},
			processImage: {
				sid: n.misc.id,
				cid: n.misc.processImage,
				params: [{
					type: "String",
					name: "url"
				}, {
					type: "PropertyArray",
					name: "imageOps",
					entity: "imageOp"
				}]
			},
			getClientAntispam: {
				sid: n.misc.id,
				cid: n.misc.getClientAntispam,
				params: [{
					type: "Property",
					name: "clientAntispam"
				}]
			},
			fileQuickTransfer: {
				sid: n.misc.id,
				cid: n.misc.fileQuickTransfer,
				params: [{
					type: "Property",
					name: "fileQuickTransfer"
				}]
			},
			getNosOriginUrl: {
				sid: n.misc.id,
				cid: n.misc.getNosOriginUrl,
				params: [{
					type: "Property",
					name: "nosFileUrlTag"
				}]
			},
			getServerTime: {
				sid: n.misc.id,
				cid: n.misc.getServerTime,
				params: []
			},
			getNosAccessToken: {
				sid: n.misc.id,
				cid: n.misc.getNosAccessToken,
				params: [{
					type: "Property",
					name: "nosAccessTokenTag"
				}]
			},
			deleteNosAccessToken: {
				sid: n.misc.id,
				cid: n.misc.deleteNosAccessToken,
				params: [{
					type: "Property",
					name: "nosAccessTokenTag"
				}]
			},
			getNosTokenTrans: {
				sid: n.misc.id,
				cid: n.misc.getNosTokenTrans,
				params: [{
					type: "Property",
					name: "transToken"
				}]
			},
			fetchFile: {
				sid: n.misc.id,
				cid: n.misc.fetchFile,
				params: [{
					type: "String",
					name: "docId"
				}]
			},
			fetchFileList: {
				sid: n.misc.id,
				cid: n.misc.fetchFileList,
				params: [{
					type: "Property",
					name: "fileListParam"
				}]
			},
			removeFile: {
				sid: n.misc.id,
				cid: n.misc.removeFile,
				params: [{
					type: "String",
					name: "docId"
				}]
			},
			getNosCdnHost: {
				sid: n.misc.id,
				cid: n.misc.getNosCdnHost,
				params: []
			},
			signalingCreate: {
				sid: n.avSignal.id,
				cid: n.avSignal.signalingCreate,
				params: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			signalingDelay: {
				sid: n.avSignal.id,
				cid: n.avSignal.signalingDelay,
				params: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			signalingClose: {
				sid: n.avSignal.id,
				cid: n.avSignal.signalingClose,
				params: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			signalingJoin: {
				sid: n.avSignal.id,
				cid: n.avSignal.signalingJoin,
				params: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			signalingLeave: {
				sid: n.avSignal.id,
				cid: n.avSignal.signalingLeave,
				params: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			signalingInvite: {
				sid: n.avSignal.id,
				cid: n.avSignal.signalingInvite,
				params: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			signalingCancel: {
				sid: n.avSignal.id,
				cid: n.avSignal.signalingCancel,
				params: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			signalingReject: {
				sid: n.avSignal.id,
				cid: n.avSignal.signalingReject,
				params: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			signalingAccept: {
				sid: n.avSignal.id,
				cid: n.avSignal.signalingAccept,
				params: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			signalingControl: {
				sid: n.avSignal.id,
				cid: n.avSignal.signalingControl,
				params: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			signalingGetChannelInfo: {
				sid: n.avSignal.id,
				cid: n.avSignal.signalingGetChannelInfo,
				params: [{
					type: "Property",
					name: "avSignalTag"
				}]
			}
		};
	e.exports = {
		idMap: n,
		cmdConfig: s,
		packetConfig: {
			"1_2": {
				service: "link",
				cmd: "heartbeat"
			},
			"1_5": {
				service: "link",
				cmd: "negotiateTransport",
				response: [{
					type: "Property",
					name: "negotiateTransportTag"
				}]
			},
			"1_6": {
				service: "link",
				cmd: "initTransport",
				response: [{
					type: "Property",
					name: "initTransportTag"
				}]
			},
			"6_1": {
				service: "misc",
				cmd: "getSimpleNosToken",
				response: [{
					type: "PropertyArray",
					name: "nosTokens",
					entity: "nosToken"
				}]
			},
			"6_2": {
				service: "misc",
				cmd: "getNosToken",
				response: [{
					type: "Property",
					name: "nosToken"
				}]
			},
			"6_3": {
				service: "misc",
				cmd: "notifyUploadLog"
			},
			"6_4": {
				service: "misc",
				cmd: "uploadSdkLogUrl"
			},
			"6_5": {
				service: "misc",
				cmd: "audioToText",
				response: [{
					type: "String",
					name: "text"
				}]
			},
			"6_6": {
				service: "misc",
				cmd: "processImage",
				response: [{
					type: "String",
					name: "url"
				}]
			},
			"6_7": {
				service: "misc",
				cmd: "getNosTokenTrans",
				response: [{
					type: "Property",
					name: "nosToken"
				}, {
					type: "String",
					name: "docId"
				}]
			},
			"6_8": {
				service: "misc",
				cmd: "notifyTransLog",
				response: [{
					type: "Property",
					name: "transInfo"
				}]
			},
			"6_9": {
				service: "misc",
				cmd: "fetchFile",
				response: [{
					type: "Property",
					name: "info",
					entity: "transInfo"
				}]
			},
			"6_10": {
				service: "misc",
				cmd: "fetchFileList",
				response: [{
					type: "PropertyArray",
					name: "list",
					entity: "transInfo"
				}, {
					type: "Number",
					name: "totalCount"
				}]
			},
			"6_11": {
				service: "misc",
				cmd: "removeFile",
				response: [{
					type: "String",
					name: "res"
				}]
			},
			"6_17": {
				service: "misc",
				cmd: "getClientAntispam",
				response: [{
					type: "Property",
					name: "clientAntispam"
				}]
			},
			"6_18": {
				service: "misc",
				cmd: "fileQuickTransfer",
				response: [{
					type: "Property",
					name: "fileQuickTransfer"
				}]
			},
			"6_22": {
				service: "misc",
				cmd: "getNosOriginUrl",
				response: [{
					type: "Property",
					name: "nosFileUrlTag"
				}]
			},
			"6_23": {
				service: "misc",
				cmd: "getServerTime",
				response: [{
					type: "Number",
					name: "time"
				}]
			},
			"6_24": {
				service: "misc",
				cmd: "getNosAccessToken",
				response: [{
					type: "Property",
					name: "nosAccessTokenTag"
				}]
			},
			"6_25": {
				service: "misc",
				cmd: "deleteNosAccessToken"
			},
			"6_26": {
				service: "misc",
				cmd: "getNosCdnHost",
				response: [{
					type: "Property",
					name: "nosConfigTag"
				}]
			},
			"6_27": {
				service: "misc",
				cmd: "getGrayscaleConfig",
				response: [{
					type: "Property",
					name: "appGrayConfigTag"
				}]
			},
			"6_28": {
				service: "misc",
				cmd: "getMixStorePolicy",
				response: [{
					type: "Property",
					name: "mixStorePolicyTag"
				}]
			},
			"6_29": {
				service: "misc",
				cmd: "getMixStoreToken",
				response: [{
					type: "Property",
					name: "mixStoreTokenTag"
				}]
			},
			"6_30": {
				service: "misc",
				cmd: "getBackSourceToken",
				response: [{
					type: "Property",
					name: "backSourceTokenTag"
				}]
			},
			"15_1": {
				service: "avSignal",
				cmd: "signalingCreate",
				response: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			"15_2": {
				service: "avSignal",
				cmd: "signalingDelay",
				response: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			"15_3": {
				service: "avSignal",
				cmd: "signalingClose",
				response: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			"15_4": {
				service: "avSignal",
				cmd: "signalingJoin",
				response: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			"15_5": {
				service: "avSignal",
				cmd: "signalingLeave",
				response: []
			},
			"15_6": {
				service: "avSignal",
				cmd: "signalingInvite",
				response: []
			},
			"15_7": {
				service: "avSignal",
				cmd: "signalingCancel",
				response: []
			},
			"15_8": {
				service: "avSignal",
				cmd: "signalingReject",
				response: []
			},
			"15_9": {
				service: "avSignal",
				cmd: "signalingAccept",
				response: []
			},
			"15_10": {
				service: "avSignal",
				cmd: "signalingControl",
				response: []
			},
			"15_11": {
				service: "avSignal",
				cmd: "signalingNotify",
				response: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			"15_12": {
				service: "avSignal",
				cmd: "signalingMutilClientSyncNotify",
				response: [{
					type: "Property",
					name: "avSignalTag"
				}]
			},
			"15_13": {
				service: "avSignal",
				cmd: "signalingUnreadMessageSyncNotify",
				response: [{
					type: "PropertyArray",
					name: "avSignalTag"
				}]
			},
			"15_14": {
				service: "avSignal",
				cmd: "signalingChannelsSyncNotify",
				response: [{
					type: "PropertyArray",
					name: "avSignalTag"
				}]
			},
			"15_15": {
				service: "avSignal",
				cmd: "signalingGetChannelInfo",
				response: [{
					type: "Property",
					name: "avSignalTag"
				}]
			}
		}
	}
}, function(e, t, n) {
	var s = n(0),
		r = s.notundef,
		i = s.fillPropertyWithDefault,
		o = Object.keys,
		a = {},
		c = {},
		m = [],
		u = {},
		l = {
			normal: 0,
			advanced: 1
		},
		d = {
			0: "normal",
			1: "advanced"
		},
		p = o(l),
		g = a.joinMode = {
			noVerify: 0,
			needVerify: 1,
			rejectAll: 2
		};
	c.joinMode = {
		0: "noVerify",
		1: "needVerify",
		2: "rejectAll"
	}, m.push("join"), u.joinMode = o(g);
	var f = a.beInviteMode = {
		needVerify: 0,
		noVerify: 1
	};
	c.beInviteMode = {
		0: "needVerify",
		1: "noVerify"
	}, m.push("beInvite"), u.beInviteMode = o(f);
	var h = a.inviteMode = {
		manager: 0,
		all: 1
	};
	c.inviteMode = {
		0: "manager",
		1: "all"
	}, m.push("invite"), u.inviteMode = o(h);
	var y = a.updateTeamMode = {
		manager: 0,
		all: 1
	};
	c.updateTeamMode = {
		0: "manager",
		1: "all"
	}, m.push("updateTeam"), u.updateTeamMode = o(y);
	var v = a.updateCustomMode = {
		manager: 0,
		all: 1
	};

	function b(e) {
		switch (s.verifyOptions(e, "action", "team::Team"), e.action) {
			case "create":
				s.verifyOptions(e, "teamId", !1, "team::Team"), s.verifyOptions(e, "type name",
					"team::Team"), s.verifyParamValid("type", e.type, p, "team::Team"), r(e.level) && (s
					.verifyParamType("level", e.level, "number", "team::Team"), this.level = e.level);
				break;
			case "update":
				s.verifyOptions(e, "teamId", "team::Team"), s.verifyOptions(e, "type", !1, "team::Team")
		}
		r(e.teamId) && (this.teamId = e.teamId), r(e.type) && (this.type = l[e.type]), r(e.avatar) && (this
				.avatar = "" + e.avatar), r(e.name) && (this.name = "" + e.name), r(e.intro) && (this
				.intro = "" + e.intro), r(e.announcement) && (this.announcement = "" + e.announcement), m
			.forEach(this.setMode.bind(this, e)), r(e.custom) && (this.custom = "" + e.custom)
	}

	function T(e, t) {
		r(e[t += "Mode"]) && (e[t] = c[t][e[t]])
	}
	c.updateCustomMode = {
		0: "manager",
		1: "all"
	}, m.push("updateCustom"), u.updateCustomMode = o(v), b.prototype.setMode = function(e, t) {
		r(e[t += "Mode"]) && (s.verifyParamValid(t, e[t], u[t], "team::Team"), this[t] = a[t][e[t]])
	}, b.reverse = function(e, t) {
		var n = s.copy(e);
		if (r(n.teamId) && (n.teamId = "" + n.teamId), r(n.type) && (n.type = d[n.type]), r(n.level) &&
			(n.level = +n.level), r(n.valid) && (n.valid = 1 == +n.valid), r(n.memberNum) && (n
				.memberNum = +n.memberNum), r(n.memberUpdateTime) && (n.memberUpdateTime = +n
				.memberUpdateTime), r(n.createTime) && (n.createTime = +n.createTime), r(n
			.updateTime) && (n.updateTime = +n.updateTime), r(n.validToCurrentUser) && (n
				.validToCurrentUser = "1" === n.validToCurrentUser), r(n.mute) && (n.mute = "1" === n
				.mute), r(n.muteType)) switch (n.muteType) {
			case "0":
				n.mute = !1, n.muteType = "none";
				break;
			case "1":
				n.mute = !0, n.muteType = "normal";
				break;
			case "3":
				n.mute = !0, n.muteType = "all"
		} else r(n.mute) && (1 === n.mute ? (n.mute = !0, n.muteType = "normal") : (n.mute = !1, n
			.muteType = "none"));
		return m.forEach(T.bind(null, n)), delete n.bits, t || b.fillProperties(n), n
	}, b.fillProperties = function(e) {
		var t = i(e, "beInviteMode", "needVerify"),
			n = i(e, "inviteMode", "manager"),
			s = i(e, "updateTeamMode", "manager"),
			r = i(e, "updateCustomMode", "manager"),
			o = i(e, "avatar", "");
		return t || n || s || r || o
	}, e.exports = b
}, function(e, t, n) {
	const s = n(5).clientTypeMap;

	function r() {}
	r.reverse = function(e) {
		var t = e;
		return t.type = s[t.type], t
	}, r.reverseType = function(e) {
		return s[e] || e
	}, e.exports = r
}, function(e, t, n) {
	var s = n(0);

	function r() {}
	r.parse = function(e) {
		var t = e.split("|");
		return {
			scene: t[0],
			to: t[1]
		}
	}, r.genSessionByMsg = function(e) {
		return {
			id: e.sessionId,
			scene: e.scene,
			to: e.target,
			updateTime: e.time,
			lastMsg: e
		}
	}, r.appendLastMsg = function(e) {
		var t = e.lastMsg;
		e["last" + s.capFirstLetter(t.type) + "Msg"] = t, e["last" + s.capFirstLetter(t.flow) + "Msg"] =
			t
	}, r.genSessionByMsgs = function(e, t) {
		var n = e.getLastNotIgnoredMsg(t);
		return n ? r.genSessionByMsg(n) : null
	}, r.trim = function(e) {
		delete e.msgReceiptSendTime, delete e.msgReceiptServerTime, delete e.ack, delete e.unreadMsgs, e
			.isDeleted || delete e.isDeleted
	}, r.isComplete = function(e) {
		return e.id && e.scene && e.to
	}, e.exports = r
}, , function(e, t, n) {
	var s = n(0),
		r = s.notundef,
		i = s.fillPropertyWithDefault,
		o = {
			0: "normal",
			1: "owner",
			2: "manager"
		};

	function a(e) {
		s.verifyOptions(e, "teamId", "superTeam::TeamMember"), s.verifyParamAtLeastPresentOne(e,
				"nickInTeam muteTeam custom", "superTeam::SuperTeamMember"), this.teamId = e.teamId, r(e
				.account) && (this.account = e.account), r(e.nickInTeam) && (this.nickInTeam = e
			.nickInTeam), r(e.muteTeam) && (this.bits = 0, e.muteTeam && (this.bits += 1)), r(e.mute) && (
				this.mute = e.mute ? 1 : 0), r(e.custom) && (this.custom = "" + e.custom)
	}
	a.reverse = function(e) {
		var t = s.copy(e);
		if (r(t.teamId) && (t.teamId = "" + t.teamId), r(t.type) && (t.type = o[t.type]), r(t.active) &&
			(t.active = 1 == +t.active), r(t.valid) && (t.valid = 1 == +t.valid), r(t.mute) && (t.mute =
				1 == +t.mute), r(t.joinTime) && (t.joinTime = +t.joinTime), r(t.updateTime) && (t
				.updateTime = +t.updateTime), r(t.bits)) {
			var n = t.bits;
			delete t.bits, t.muteTeam = !!(1 & n)
		}
		return r(t.teamId) && r(t.account) && (t.id = a.genId(t.teamId, t.account)), t
	}, a.reverseMembers = function(e) {
		return e.map((function(e) {
			return a.reverse(e)
		}))
	}, a.fillProperties = function(e) {
		var t = i(e, "mute", !1),
			n = i(e, "custom", "");
		return t || n
	}, a.genId = function(e, t) {
		return e + "-" + t
	}, a.accounts2ids = function(e, t) {
		return t.map((function(t) {
			return a.genId(e, t)
		}))
	}, a.assembleMembers = function(e, t) {
		return s.isArray(t) || (t = [t]), t.map((function(t) {
			return a.assembleMember(e, t)
		}))
	}, a.assembleMember = function(e, t) {
		return {
			id: a.genId(e.teamId, t),
			account: t,
			teamId: e.teamId,
			type: "normal",
			nickInTeam: "",
			muteTeam: !1,
			mute: !1,
			joinTime: e.memberUpdateTime,
			updateTime: e.memberUpdateTime,
			active: !0,
			valid: !0
		}
	}, a.assembleOwner = function(e) {
		var t = a.assembleMember(e, e.owner);
		return t.type = "owner", t
	}, e.exports = a
}, function(e, t, n) {
	const {
		genPrivateUrl: s
	} = n(16);
	var r = n(0),
		i = {
			unknown: 0,
			male: 1,
			female: 2
		},
		o = {
			0: "unknown",
			1: "male",
			2: "female"
		};

	function a(e) {
		r.merge(this, e), r.notundef(this.gender) && (r.verifyParamValid("gender", this.gender, a
				.validGenders, "user::User"), this.gender = i[this.gender]), r.notundef(this.email) &&
			"" !== this.email && r.verifyEmail("email", this.email, "user::User"), r.notundef(this.birth) &&
			"" !== this.birth && r.verifyBirth("birth", this.birth, "user::User"), r.notundef(this.tel) &&
			"" !== this.tel && r.verifyTel("tel", this.tel, "user::User")
	}
	a.reverse = function(e) {
		var t = r.filterObj(e,
			"account nick avatar _avatar_safe sign gender email birth tel custom createTime updateTime"
			);
		return r.notundef(t.avatar) && (t.avatar = s(t.avatar)), r.notundef(t.gender) && (t.gender = o[t
			.gender]), r.notundef(t.createTime) && (t.createTime = +t.createTime), r.notundef(t
			.updateTime) && (t.updateTime = +t.updateTime), t
	}, a.reverseUsers = function(e) {
		return e.map((function(e) {
			return a.reverse(e)
		}))
	}, a.validGenders = Object.keys(i), e.exports = a
}, function(e, t, n) {
	const {
		genPrivateUrl: s
	} = n(16);
	var r = n(15),
		i = n(0),
		o = n(1);

	function a(e) {
		switch (i.notundef(e.type) ? i.verifyFileType(e.type, "msg::FileMessage") : e.type = "file", i
			.verifyOptions(e, "file", "msg::FileMessage"), i.verifyOptions(e.file, "url ext size", !0,
				"file.", "msg::FileMessage"), e.type) {
			case "image":
				c.verifyFile(e.file, "msg::FileMessage");
				break;
			case "audio":
				m.verifyFile(e.file, "msg::FileMessage");
				break;
			case "video":
				u.verifyFile(e.file, "msg::FileMessage")
		}
		r.call(this, e), this.attach = JSON.stringify(e.file)
	}
	a.prototype = Object.create(r.prototype), a.reverse = function(e) {
		var t = r.reverse(e);
		return e.attach = e.attach ? "" + e.attach : "", t.file = e.attach ? JSON.parse(e.attach) : {},
			t.file.url = s(t.file.url), "audio" !== t.type || t.file.mp3Url || (t.file.mp3Url = t.file
				.url + (~t.file.url.indexOf("?") ? "&" : "?") + "audioTrans&type=mp3"), o
			.httpsEnabled && 0 !== t.file.url.indexOf("https://") && (t.file.url = t.file.url.replace(
				"http", "https")), t
	}, e.exports = a;
	var c = n(145),
		m = n(146),
		u = n(147)
}, , , function(e, t) {
	e.exports = new class {
		getItem(e) {
			return wx.getStorageSync(e)
		}
		setItem(e, t) {
			return wx.setStorageSync(e, t)
		}
		removeItem(e) {
			return this.setItem(e, "")
		}
		clear() {
			return wx.clearStorageSync()
		}
	}
}, function(e, t, n) {
	const s = n(36),
		r = n(22);

	function i(e) {
		this.status = e.statusCode, this.statusText = e.statusCode, e.header && (this._responseHeaders =
			Object.keys(e.header).reduce((t, n) => (t[n.toLowerCase()] = e.header[n], t), {}));
		let t = e.data;
		"string" != typeof t && (t = JSON.stringify(t)), this.responseText = this.response = t, this
			.readyState = 4, this.dispatchEvent({
				type: "readystatechange"
			})
	}
	class o {
		dispatchEvent(e) {
			const t = "on" + e.type;
			"function" == typeof this[t] && this[t](e)
		}
	}
	class a {
		constructor() {
			this.readyState = 0, this._headers = {}, this.upload = new o
		}
		dispatchEvent(e) {
			const t = "on" + e.type;
			"function" == typeof this[t] && this[t](e)
		}
		abort() {
			if (!this._request || this._request.abort) return this.status = 0, this.readyState = 4, this
				._request.abort();
			throw new Error("该版本基础库不支持 abort request")
		}
		getAllResponseHeaders() {
			return this._responseHeaders ? Object.keys(this._responseHeaders).map(e =>
				`${e}: ${this._responseHeaders[e]}`).join("\r\n") : ""
		}
		getResponseHeader(e) {
			const t = e.toLowerCase();
			return this._responseHeaders && this._responseHeaders[t] ? this._responseHeaders[t] : null
		}
		overrideMimeType() {
			throw new Error("not supported in weapp")
		}
		open(e, t, n = !0) {
			if (0 !== this.readyState) throw new Error("request is already opened");
			if (!n) throw new Error("sync request is not supported");
			this._method = e, t = t.replace(/:443(\/|$)/, "$1"), this._url = t, this.readyState = 1,
				this.dispatchEvent({
					type: "readystatechange"
				})
		}
		setRequestHeader(e, t) {
			if (1 !== this.readyState) throw new Error("request is not opened");
			this._headers[e.toLowerCase()] = t
		}
		send(e) {
			if (1 !== this.readyState) throw new Error("request is not opened");
			if (e instanceof r) {
				const t = e.entries(),
					n = t.filter(e => "string" != typeof e[1]);
				if (0 === n.length) throw new Error("Must specify a Blob field in FormData");
				n.length > 1 && console.warn("Only the first Blob will be send in Weapp");
				const r = t.filter(e => "string" == typeof e[1]).reduce((e, t) => s(e, {
					[t[0]]: t[1]
				}), {});
				this._request = wx.uploadFile({
						url: this._url,
						name: n[0][0],
						filePath: n[0][1].uri,
						formData: r,
						header: this._headers,
						success: i.bind(this),
						fail: e => {
							this.status = 0, this.readyState = 4, this.dispatchEvent({
								type: "readystatechange"
							}), this.dispatchEvent({
								type: "error"
							})
						}
					}), this._request && this._request.onProgressUpdate && this._request
					.onProgressUpdate(({
						totalBytesSent: e,
						totalBytesExpectedToSend: t
					}) => {
						this.upload.dispatchEvent({
							type: "progress",
							loaded: e,
							total: t
						})
					})
			} else this._request = wx.request({
				url: this._url,
				data: e || "",
				method: this._method.toUpperCase(),
				header: this._headers,
				success: i.bind(this),
				fail: e => {
					this.status = 0, this.readyState = 4, this.dispatchEvent({
						type: "readystatechange"
					}), this.dispatchEvent({
						type: "error"
					})
				}
			})
		}
	}
	s(a, {
		UNSENT: 0,
		OPENED: 1,
		HEADERS_RECEIVED: 2,
		LOADING: 3,
		DONE: 4
	}), e.exports = a
}, function(e, t, n) {
	"use strict";
	/*
	object-assign
	(c) Sindre Sorhus
	@license MIT
	*/
	var s = Object.getOwnPropertySymbols,
		r = Object.prototype.hasOwnProperty,
		i = Object.prototype.propertyIsEnumerable;

	function o(e) {
		if (null == e) throw new TypeError("Object.assign cannot be called with null or undefined");
		return Object(e)
	}
	e.exports = function() {
		try {
			if (!Object.assign) return !1;
			var e = new String("abc");
			if (e[5] = "de", "5" === Object.getOwnPropertyNames(e)[0]) return !1;
			for (var t = {}, n = 0; n < 10; n++) t["_" + String.fromCharCode(n)] = n;
			if ("0123456789" !== Object.getOwnPropertyNames(t).map((function(e) {
					return t[e]
				})).join("")) return !1;
			var s = {};
			return "abcdefghijklmnopqrst".split("").forEach((function(e) {
				s[e] = e
			})), "abcdefghijklmnopqrst" === Object.keys(Object.assign({}, s)).join("")
		} catch (e) {
			return !1
		}
	}() ? Object.assign : function(e, t) {
		for (var n, a, c = o(e), m = 1; m < arguments.length; m++) {
			for (var u in n = Object(arguments[m])) r.call(n, u) && (c[u] = n[u]);
			if (s) {
				a = s(n);
				for (var l = 0; l < a.length; l++) i.call(n, a[l]) && (c[a[l]] = n[a[l]])
			}
		}
		return c
	}
}, function(e, t, n) {
	const s = n(36);
	class r {
		constructor(e, t) {
			if (!e) throw new TypeError("Failed to construct 'WebSocket': url required");
			if (t && (!wx.canIUse || !wx.canIUse("connectSocket.object.protocols"))) throw new Error(
				"subprotocal not supported in weapp");
			e = e.replace(/:443(\/|$)/, "$1"), this._url = e, this._protocal = t || "", this
				._readyState = 0, this._socketTask = wx.connectSocket({
					url: e,
					protocals: this._protocal,
					fail: e => {
						console.info("wx::ws: sockets build failed ..."), this.errorHandler(e)
					},
					success: e => {
						console.log("wx::ws: sockets build succeed ...")
					}
				}), this._socketTask.onOpen(e => {
					this._readyState = 1, console.log("wx::ws: onopen ", e), this.dispatchEvent({
						type: "open"
					})
				}), this._socketTask.onError(e => {
					this.errorHandler(e)
				}), this._socketTask.onClose(e => {
					this._readyState = 3, console.log("wx::ws: onclose ", e);
					const {
						code: t,
						reason: n,
						wasClean: s
					} = e;
					this.dispatchEvent({
						code: t,
						reason: n,
						wasClean: s,
						type: "close"
					}), this._socketTask = null
				}), this._socketTask.onMessage(e => {
					const {
						data: t,
						origin: n,
						ports: s,
						source: r
					} = e;
					this.dispatchEvent({
						data: t,
						origin: n,
						ports: s,
						source: r,
						type: "message"
					})
				})
		}
		get url() {
			return this._url
		}
		get protocal() {
			return this._protocal
		}
		get readyState() {
			return this._readyState
		}
		dispatchEvent(e) {
			const t = "on" + e.type;
			"function" == typeof this[t] && this[t](e)
		}
		close() {
			try {
				console.log("wx::ws:close WebSocket force close: readystate " + this._readyState), this
					._socketTask.close({
						code: 1e3,
						reason: "wx::ws:user force close websocket",
						complete: () => {}
					})
			} catch (e) {
				console.warn("wx::ws:close WebSocket force error", e)
			}
		}
		send(e) {
			if (1 !== this._readyState) throw new Error("wx:ws: sendMsg when readyState=" + this
				._readyState);
			if (!("string" == typeof e || e instanceof ArrayBuffer)) throw new TypeError(
				"wx:ws: sendMsg only String/ArrayBuffer supported");
			this._socketTask.send({
				data: e
			})
		}
		errorHandler(e) {
			console.error("wx::ws: onerror ", e), this._readyState = 3, this.dispatchEvent({
					type: "error",
					message: e.errMsg
				}), e.errMsg && "[object Array]" === Object.prototype.toString.call(e.errMsg) && (e
					.errMsg.indexOf("断裂管道") > 0 || e.errMsg.indexOf("broken pipe") > 0) && this
				.dispatchEvent({
					code: 1006,
					reason: e.errMsg,
					type: "close"
				}), this._socketTask = null
		}
	}
	s(r, {
		CONNECTING: 0,
		OPEN: 1,
		CLOSING: 2,
		CLOSED: 3
	}), e.exports = r
}, function(e, t) {
	e.exports = {}
}, function(e, t) {
	e.exports = function e(t, n) {
		"use strict";
		var s, r, i = /(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,
			o = /(^[ ]*|[ ]*$)/g,
			a =
			/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,
			c = /^0x[0-9a-f]+$/i,
			m = /^0/,
			u = function(t) {
				return e.insensitive && ("" + t).toLowerCase() || "" + t
			},
			l = u(t).replace(o, "") || "",
			d = u(n).replace(o, "") || "",
			p = l.replace(i, "\0$1\0").replace(/\0$/, "").replace(/^\0/, "").split("\0"),
			g = d.replace(i, "\0$1\0").replace(/\0$/, "").replace(/^\0/, "").split("\0"),
			f = parseInt(l.match(c), 16) || 1 !== p.length && l.match(a) && Date.parse(l),
			h = parseInt(d.match(c), 16) || f && d.match(a) && Date.parse(d) || null;
		if (h) {
			if (f < h) return -1;
			if (f > h) return 1
		}
		for (var y = 0, v = Math.max(p.length, g.length); y < v; y++) {
			if (s = !(p[y] || "").match(m) && parseFloat(p[y]) || p[y] || 0, r = !(g[y] || "").match(
				m) && parseFloat(g[y]) || g[y] || 0, isNaN(s) !== isNaN(r)) return isNaN(s) ? 1 : -1;
			if (typeof s != typeof r && (s += "", r += ""), s < r) return -1;
			if (s > r) return 1
		}
		return 0
	}
}, function(e, t) {
	e.exports = function(e, t) {
		var n = t.split(".");
		for (; n.length;) {
			var s = n.shift(),
				r = !1;
			if ("?" == s[s.length - 1] && (s = s.slice(0, -1), r = !0), !(e = e[s]) && r) return e
		}
		return e
	}
}, function(e, t, n) {
	const s = n(6),
		r = s.getGlobal(),
		i = {},
		o = r.name || "_parent",
		a = [],
		c = [];
	i.addMsgListener = function(e) {
		a.push(e)
	};
	const m = (u = /^([\w]+?:\/\/.*?(?=\/|$))/i, function(e) {
		return e = e || "", u.test(e) ? RegExp.$1 : "*"
	});
	var u;
	const l = () => {
			var e = unescape(r.name || "").trim();
			if (!e || 0 !== e.indexOf("MSG|")) return;
			r.name = "";
			const t = s.string2object(e.replace("MSG|", ""), "|"),
				n = (t.origin || "").toLowerCase();
			n && "*" !== n && 0 !== location.href.toLowerCase().indexOf(n) || function(e) {
				for (var t = 0, n = a.length; t < n; t++) try {
					a[t].call(null, e)
				} catch (e) {}
			}({
				data: JSON.parse(t.data || "null"),
				source: r.frames[t.self] || t.self,
				origin: m(t.ref || ("undefined" == typeof document ? "" : document.referrer))
			})
		},
		d = (g = function(e, t) {
			for (var n = 0, s = e.length; n < s; n++)
				if (e[n] === t) return !0;
			return !1
		}, function() {
			if (c.length) {
				p = [];
				for (var e, t = c.length - 1; t >= 0; t--) e = c[t], g(p, e.w) || (p.push(e.w), c
					.splice(t, 1), e.w.name = e.d);
				p = null
			}
		});
	var p, g;
	const f = i.startTimer = (() => {
		let e = !1;
		return () => {
			e || (e = !0, r.postMessage || (setInterval(d, 100), setInterval(l, 20)))
		}
	})();
	i.postMessage = (e, t = {}) => {
		if (s.fillUndef(t, {
				origin: "*",
				source: o
			}), r.postMessage) {
			let n = t.data;
			r.FormData || (n = JSON.stringify(n)), e.postMessage(n, t.origin)
		} else {
			if (f(), s.isObject(t)) {
				var n = {};
				n.origin = t.origin || "", n.ref = location.href, n.self = t.source, n.data = JSON
					.stringify(t.data), t = "MSG|" + s.object2string(n, "|", !0)
			}
			c.unshift({
				w: e,
				d: escape(t)
			})
		}
	}, e.exports = i
}, function(e, t, n) {
	var s = n(0),
		r = {
			file: {
				md5: "$(Etag)",
				size: "$(ObjectSize)"
			},
			image: {
				md5: "$(Etag)",
				size: "$(ObjectSize)",
				w: "$(ImageInfo.Width)",
				h: "$(ImageInfo.Height)",
				orientation: "$(ImageInfo.Orientation)"
			},
			audio: {
				md5: "$(Etag)",
				size: "$(ObjectSize)",
				dur: "$(AVinfo.Audio.Duration)"
			},
			video: {
				md5: "$(Etag)",
				size: "$(ObjectSize)",
				dur: "$(AVinfo.Video.Duration)",
				w: "$(AVinfo.Video.Width)",
				h: "$(AVinfo.Video.Height)"
			}
		},
		i = {
			genResponseBody: function(e) {
				return r[e = e || "file"]
			},
			parseResponse: function(e, t) {
				s.notundef(e.size) && (e.size = +e.size), s.notundef(e.w) && (e.w = +e.w), s.notundef(e
					.h) && (e.h = +e.h), s.notundef(e.dur) && (e.dur = +e.dur);
				var n = e.orientation;
				if (s.notundef(n) && (delete e.orientation, t && ("right, top" === n ||
						"left, bottom" === n))) {
					var r = e.w;
					e.w = e.h, e.h = r
				}
				return e
			}
		};
	e.exports = i
}, function(e, t, n) {
	var s = n(0),
		r = {
			fromDataURL: function(e) {
				const t = s.getGlobal();
				let n;
				n = e.split(",")[0].indexOf("base64") >= 0 ? t.atob(e.split(",")[1]) : t
					.decodeURIComponent(e.split(",")[1]);
				const r = e.split(",")[0].split(":")[1].split(";")[0],
					i = new Uint8Array(n.length);
				for (let e = 0; e < n.length; e++) i[e] = n.charCodeAt(e);
				return new t.Blob([i], {
					type: r
				})
			}
		};
	e.exports = r
}, function(e, t, n) {
	var s = n(0),
		r = {
			stripmeta: 0,
			blur: 2,
			quality: 3,
			crop: 4,
			rotate: 5,
			thumbnail: 7,
			interlace: 9
		},
		i = {
			0: "stripmeta",
			1: "type",
			2: "blur",
			3: "quality",
			4: "crop",
			5: "rotate",
			6: "pixel",
			7: "thumbnail",
			8: "watermark",
			9: "interlace",
			10: "tmp"
		};

	function o(e) {
		s.verifyOptions(e, "type", "image::ImageOp"), s.verifyParamValid("type", e.type, o.validTypes,
			"image::ImageOp"), s.merge(this, e), this.type = r[e.type]
	}
	o.validTypes = Object.keys(r), o.reverse = function(e) {
		var t = s.copy(e);
		return t.type = i[t.type], t
	}, o.reverseImageOps = function(e) {
		return e.map((function(e) {
			return o.reverse(e)
		}))
	}, e.exports = o
}, function(e, t) {
	const n = {
			1: "ROOM_CLOSE",
			2: "ROOM_JOIN",
			3: "INVITE",
			4: "CANCEL_INVITE",
			5: "REJECT",
			6: "ACCEPT",
			7: "LEAVE",
			8: "CONTROL"
		},
		s = {
			1: "accid",
			2: "uid",
			3: "createTime",
			4: "expireTime",
			5: "web_uid"
		},
		r = {
			10404: "ROOM_NOT_EXISTS",
			10405: "ROOM_HAS_EXISTS",
			10406: "ROOM_MEMBER_NOT_EXISTS",
			10407: "ROOM_MEMBER_HAS_EXISTS",
			10408: "INVITE_NOT_EXISTS",
			10409: "INVITE_HAS_REJECT",
			10410: "INVITE_HAS_ACCEPT",
			10201: "PEER_NIM_OFFLINE",
			10202: "PEER_PUSH_OFFLINE",
			10419: "ROOM_MEMBER_EXCEED",
			10420: "ROOM_MEMBER_HAS_EXISTS_OTHER_CLIENT",
			10417: "UID_CONFLICT"
		};
	e.exports = {
		parseAvSignalType: e => n[e] || e,
		parseAvSignalMember: e => {
			const t = {};
			return Object.keys(e).forEach(n => {
				t[s[n]] = e[n]
			}), t
		},
		parseAvSignalError: e => (e.message = r[e.code] || e.message || e, e)
	}
}, function(module, exports, __webpack_require__) {
	(function(global, module) {
		var __WEBPACK_AMD_DEFINE_ARRAY__,
		__WEBPACK_AMD_DEFINE_RESULT__; /*! Socket.IO.js build:0.9.11, development. Copyright(c) 2011 LearnBoost <dev@learnboost.com> MIT Licensed */
		function getGlobal() {
			return "undefined" != typeof window ? window : "undefined" != typeof self ? self :
				void 0 !== global ? global : {}
		}
		var root = getGlobal(),
			io = module.exports;
		void 0 === root.location && (root.location = null), root.io ? module && (module.exports = io =
				root.io) : root.io = io,
			function() {
				! function(e, t) {
					var n = e;
					n.version = "0.9.11", n.protocol = 1, n.transports = [], n.j = [], n.sockets = {}, n
						.connect = function(e, s) {
							var r, i, o = n.util.parseUri(e);
							t && t.location && (o.protocol = o.protocol || t.location.protocol.slice(0,
									-1), o.host = o.host || (t.document ? t.document.domain : t
									.location.hostname), o.port = o.port || t.location.port), r = n.util
								.uniqueUri(o);
							var a = {
								host: o.ipv6uri ? "[" + o.host + "]" : o.host,
								secure: "https" === o.protocol,
								port: o.port || ("https" === o.protocol ? 443 : 80),
								query: o.query || ""
							};
							return n.util.merge(a, s), !a["force new connection"] && n.sockets[r] || (
								i = new n.Socket(a)), !a["force new connection"] && i && (n.sockets[
								r] = i), (i = i || n.sockets[r]).of(o.path.length > 1 ? o.path : "")
						}
				}(module.exports, root),
				function(e, t) {
					var n = e.util = {},
						s =
						/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,
						r = ["source", "protocol", "authority", "userInfo", "user", "password", "host",
							"port", "relative", "path", "directory", "file", "query", "anchor"
						];
					n.parseUri = function(e) {
						var t = e,
							n = e.indexOf("["),
							i = e.indexOf("]"); - 1 != n && -1 != i && (e = e.substring(0, n) + e
							.substring(n, i).replace(/:/g, ";") + e.substring(i, e.length));
						for (var o = s.exec(e || ""), a = {}, c = 14; c--;) a[r[c]] = o[c] || "";
						return -1 != n && -1 != i && (a.source = t, a.host = a.host.substring(1, a
								.host.length - 1).replace(/;/g, ":"), a.authority = a.authority
							.replace("[", "").replace("]", "").replace(/;/g, ":"), a.ipv6uri = !
							0), a
					}, n.uniqueUri = function(e) {
						var n = e.protocol,
							s = e.host,
							r = e.port;
						return "document" in t && t.document ? (s = s || document.domain, r = r || (
							"https" == n && "https:" !== document.location.protocol ? 443 :
							document.location.port)) : (s = s || "localhost", r || "https" !=
							n || (r = 443)), (n || "http") + "://" + s + ":" + (r || 80)
					}, n.query = function(e, t) {
						var s = n.chunkQuery(e || ""),
							r = [];
						for (var i in n.merge(s, n.chunkQuery(t || "")), s) s.hasOwnProperty(i) && r
							.push(i + "=" + s[i]);
						return r.length ? "?" + r.join("&") : ""
					}, n.chunkQuery = function(e) {
						for (var t, n = {}, s = e.split("&"), r = 0, i = s.length; r < i; ++r)(t =
							s[r].split("="))[0] && (n[t[0]] = t[1]);
						return n
					};
					var i = !1;
					n.load = function(e) {
							if ("undefined" != typeof document && document && "complete" === document
								.readyState || i) return e();
							n.on(t, "load", e, !1)
						}, n.on = function(e, t, n, s) {
							e.attachEvent ? e.attachEvent("on" + t, n) : e.addEventListener && e
								.addEventListener(t, n, s)
						}, n.request = function(e) {
							if (e && "undefined" != typeof XDomainRequest && !n.ua.hasCORS)
							return new XDomainRequest;
							if ("undefined" != typeof XMLHttpRequest && (!e || n.ua.hasCORS))
							return new XMLHttpRequest;
							if (!e) try {
								return new(root[["Active"].concat("Object").join("X")])(
									"Microsoft.XMLHTTP")
							} catch (e) {}
							return null
						}, void 0 !== root && n.load((function() {
							i = !0
						})), n.defer = function(e) {
							if (!n.ua.webkit || "undefined" != typeof importScripts) return e();
							n.load((function() {
								setTimeout(e, 100)
							}))
						}, n.merge = function(e, t, s, r) {
							var i, o = r || [],
								a = void 0 === s ? 2 : s;
							for (i in t) t.hasOwnProperty(i) && n.indexOf(o, i) < 0 && ("object" ==
								typeof e[i] && a ? n.merge(e[i], t[i], a - 1, o) : (e[i] = t[i], o
									.push(t[i])));
							return e
						}, n.mixin = function(e, t) {
							n.merge(e.prototype, t.prototype)
						}, n.inherit = function(e, t) {
							function n() {}
							n.prototype = t.prototype, e.prototype = new n
						}, n.isArray = Array.isArray || function(e) {
							return "[object Array]" === Object.prototype.toString.call(e)
						}, n.intersect = function(e, t) {
							for (var s = [], r = e.length > t.length ? e : t, i = e.length > t.length ?
									t : e, o = 0, a = i.length; o < a; o++) ~n.indexOf(r, i[o]) && s
								.push(i[o]);
							return s
						}, n.indexOf = function(e, t, n) {
							var s = e.length;
							for (n = n < 0 ? n + s < 0 ? 0 : n + s : n || 0; n < s && e[n] !== t; n++);
							return s <= n ? -1 : n
						}, n.toArray = function(e) {
							for (var t = [], n = 0, s = e.length; n < s; n++) t.push(e[n]);
							return t
						}, n.ua = {}, n.ua.hasCORS = "undefined" != typeof XMLHttpRequest &&
					function() {
							try {
								var e = new XMLHttpRequest
							} catch (e) {
								return !1
							}
							return null != e.withCredentials
						}(), n.ua.webkit = "undefined" != typeof navigator && /webkit/i.test(navigator
							.userAgent), n.ua.iDevice = "undefined" != typeof navigator &&
						/iPad|iPhone|iPod/i.test(navigator.userAgent)
				}(void 0 !== io ? io : module.exports, root),
				function(e, t) {
					function n() {}
					e.EventEmitter = n, n.prototype.on = function(e, n) {
						return this.$events || (this.$events = {}), this.$events[e] ? t.util
							.isArray(this.$events[e]) ? this.$events[e].push(n) : this.$events[
							e] = [this.$events[e], n] : this.$events[e] = n, this
					}, n.prototype.addListener = n.prototype.on, n.prototype.once = function(e, t) {
						var n = this;

						function s() {
							n.removeListener(e, s), t.apply(this, arguments)
						}
						return s.listener = t, this.on(e, s), this
					}, n.prototype.removeListener = function(e, n) {
						if (this.$events && this.$events[e]) {
							var s = this.$events[e];
							if (t.util.isArray(s)) {
								for (var r = -1, i = 0, o = s.length; i < o; i++)
									if (s[i] === n || s[i].listener && s[i].listener === n) {
										r = i;
										break
									} if (r < 0) return this;
								s.splice(r, 1), s.length || delete this.$events[e]
							} else(s === n || s.listener && s.listener === n) && delete this
								.$events[e]
						}
						return this
					}, n.prototype.removeAllListeners = function(e) {
						return void 0 === e ? (this.$events = {}, this) : (this.$events && this
							.$events[e] && (this.$events[e] = null), this)
					}, n.prototype.listeners = function(e) {
						return this.$events || (this.$events = {}), this.$events[e] || (this
							.$events[e] = []), t.util.isArray(this.$events[e]) || (this.$events[
							e] = [this.$events[e]]), this.$events[e]
					}, n.prototype.emit = function(e) {
						if (!this.$events) return !1;
						var n = this.$events[e];
						if (!n) return !1;
						var s = Array.prototype.slice.call(arguments, 1);
						if ("function" == typeof n) n.apply(this, s);
						else {
							if (!t.util.isArray(n)) return !1;
							for (var r = n.slice(), i = 0, o = r.length; i < o; i++) r[i].apply(
								this, s)
						}
						return !0
					}
				}(void 0 !== io ? io : module.exports, void 0 !== io ? io : module.parent.exports),
				function(exports, nativeJSON) {
					"use strict";
					if (nativeJSON && nativeJSON.parse) return exports.JSON = {
						parse: nativeJSON.parse,
						stringify: nativeJSON.stringify
					};
					var JSON = exports.JSON = {};

					function f(e) {
						return e < 10 ? "0" + e : e
					}

					function date(e, t) {
						return isFinite(e.valueOf()) ? e.getUTCFullYear() + "-" + f(e.getUTCMonth() +
							1) + "-" + f(e.getUTCDate()) + "T" + f(e.getUTCHours()) + ":" + f(e
								.getUTCMinutes()) + ":" + f(e.getUTCSeconds()) + "Z" : null
					}
					var cx =
						/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
						escapable =
						/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
						gap, indent, meta = {
							"\b": "\\b",
							"\t": "\\t",
							"\n": "\\n",
							"\f": "\\f",
							"\r": "\\r",
							'"': '\\"',
							"\\": "\\\\"
						},
						rep;

					function quote(e) {
						return escapable.lastIndex = 0, escapable.test(e) ? '"' + e.replace(escapable, (
							function(e) {
								var t = meta[e];
								return "string" == typeof t ? t : "\\u" + ("0000" + e
									.charCodeAt(0).toString(16)).slice(-4)
							})) + '"' : '"' + e + '"'
					}

					function str(e, t) {
						var n, s, r, i, o, a = gap,
							c = t[e];
						switch (c instanceof Date && (c = date(e)), "function" == typeof rep && (c = rep
							.call(t, e, c)), typeof c) {
							case "string":
								return quote(c);
							case "number":
								return isFinite(c) ? String(c) : "null";
							case "boolean":
							case "null":
								return String(c);
							case "object":
								if (!c) return "null";
								if (gap += indent, o = [], "[object Array]" === Object.prototype
									.toString.apply(c)) {
									for (i = c.length, n = 0; n < i; n += 1) o[n] = str(n, c) || "null";
									return r = 0 === o.length ? "[]" : gap ? "[\n" + gap + o.join(
											",\n" + gap) + "\n" + a + "]" : "[" + o.join(",") + "]",
										gap = a, r
								}
								if (rep && "object" == typeof rep)
									for (i = rep.length, n = 0; n < i; n += 1) "string" == typeof rep[
										n] && (r = str(s = rep[n], c)) && o.push(quote(s) + (gap ?
											": " : ":") + r);
								else
									for (s in c) Object.prototype.hasOwnProperty.call(c, s) && (r = str(
										s, c)) && o.push(quote(s) + (gap ? ": " : ":") + r);
								return r = 0 === o.length ? "{}" : gap ? "{\n" + gap + o.join(",\n" +
									gap) + "\n" + a + "}" : "{" + o.join(",") + "}", gap = a, r
						}
					}
					JSON.stringify = function(e, t, n) {
						var s;
						if (gap = "", indent = "", "number" == typeof n)
							for (s = 0; s < n; s += 1) indent += " ";
						else "string" == typeof n && (indent = n);
						if (rep = t, t && "function" != typeof t && ("object" != typeof t ||
								"number" != typeof t.length)) throw new Error(
							"socket.io:: replacer cannot JSON.stringify");
						return str("", {
							"": e
						})
					}, JSON.parse = function(text, reviver) {
						var j;

						function walk(e, t) {
							var n, s, r = e[t];
							if (r && "object" == typeof r)
								for (n in r) Object.prototype.hasOwnProperty.call(r, n) && (
									void 0 !== (s = walk(r, n)) ? r[n] = s : delete r[n]);
							return reviver.call(e, t, r)
						}
						if (text = String(text), cx.lastIndex = 0, cx.test(text) && (text = text
								.replace(cx, (function(e) {
									return "\\u" + ("0000" + e.charCodeAt(0).toString(16))
										.slice(-4)
								}))), /^[\],:{}\s]*$/.test(text.replace(
								/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(
								/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
								"]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return j = eval("(" +
							text + ")"), "function" == typeof reviver ? walk({
							"": j
						}, "") : j;
						throw new SyntaxError("socket.io:: reviver cannot JSON.parse")
					}
				}(void 0 !== io ? io : module.exports, "undefined" != typeof JSON ? JSON : void 0),
				function(e, t) {
					var n = e.parser = {},
						s = n.packets = ["disconnect", "connect", "heartbeat", "message", "json",
							"event", "ack", "error", "noop"
						],
						r = n.reasons = ["transport not supported", "client not handshaken",
							"unauthorized"
						],
						i = n.advice = ["reconnect"],
						o = t.JSON,
						a = t.util.indexOf;
					n.encodePacket = function(e) {
						var t = a(s, e.type),
							n = e.id || "",
							c = e.endpoint || "",
							m = e.ack,
							u = null;
						switch (e.type) {
							case "error":
								var l = e.reason ? a(r, e.reason) : "",
									d = e.advice ? a(i, e.advice) : "";
								"" === l && "" === d || (u = l + ("" !== d ? "+" + d : ""));
								break;
							case "message":
								"" !== e.data && (u = e.data);
								break;
							case "event":
								var p = {
									name: e.name
								};
								e.args && e.args.length && (p.args = e.args), u = o.stringify(p);
								break;
							case "json":
								u = o.stringify(e.data);
								break;
							case "connect":
								e.qs && (u = e.qs);
								break;
							case "ack":
								u = e.ackId + (e.args && e.args.length ? "+" + o.stringify(e.args) :
									"")
						}
						var g = [t, n + ("data" == m ? "+" : ""), c];
						return null != u && g.push(u), g.join(":")
					}, n.encodePayload = function(e) {
						var t = "";
						if (1 == e.length) return e[0];
						for (var n = 0, s = e.length; n < s; n++) {
							t += "�" + e[n].length + "�" + e[n]
						}
						return t
					};
					var c = /([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/;
					n.decodePacket = function(e) {
						if (!(a = e.match(c))) return {};
						var t = a[2] || "",
							n = (e = a[5] || "", {
								type: s[a[1]],
								endpoint: a[4] || ""
							});
						switch (t && (n.id = t, a[3] ? n.ack = "data" : n.ack = !0), n.type) {
							case "error":
								var a = e.split("+");
								n.reason = r[a[0]] || "", n.advice = i[a[1]] || "";
								break;
							case "message":
								n.data = e || "";
								break;
							case "event":
								try {
									var m = o.parse(e);
									n.name = m.name, n.args = m.args
								} catch (e) {}
								n.args = n.args || [];
								break;
							case "json":
								try {
									n.data = o.parse(e)
								} catch (e) {}
								break;
							case "connect":
								n.qs = e || "";
								break;
							case "ack":
								if ((a = e.match(/^([0-9]+)(\+)?(.*)/)) && (n.ackId = a[1], n
										.args = [], a[3])) try {
									n.args = a[3] ? o.parse(a[3]) : []
								} catch (e) {}
						}
						return n
					}, n.decodePayload = function(e) {
						var t = function(e, t) {
							for (var n = 0, s = e; s < t.length; s++) {
								if ("�" == t.charAt(s)) return n;
								n++
							}
							return n
						};
						if ("�" == e.charAt(0)) {
							for (var s = [], r = 1, i = ""; r < e.length; r++)
								if ("�" == e.charAt(r)) {
									var o = e.substr(r + 1).substr(0, i);
									if ("�" != e.charAt(r + 1 + Number(i)) && r + 1 + Number(i) != e
										.length) {
										var a = Number(i);
										l = t(r + a + 1, e), o = e.substr(r + 1).substr(0, a + l),
											r += l
									}
									s.push(n.decodePacket(o)), r += Number(i) + 1, i = ""
								} else i += e.charAt(r);
							return s
						}
						return [n.decodePacket(e)]
					}
				}(void 0 !== io ? io : module.exports, void 0 !== io ? io : module.parent.exports),
				function(e, t) {
					function n(e, t) {
						this.socket = e, this.sessid = t
					}
					e.Transport = n, t.util.mixin(n, t.EventEmitter), n.prototype.heartbeats =
						function() {
							return !0
						}, n.prototype.onData = function(e) {
							if (this !== this.socket.transport) return this;
							if (this.clearCloseTimeout(), (this.socket.connected || this.socket
									.connecting || this.socket.reconnecting) && this.setCloseTimeout(),
								"" !== e) {
								var n = t.parser.decodePayload(e);
								if (n && n.length)
									for (var s = 0, r = n.length; s < r; s++) this.onPacket(n[s])
							}
							return this
						}, n.prototype.onPacket = function(e) {
							return this.socket.setHeartbeatTimeout(), "heartbeat" == e.type ? this
								.onHeartbeat() : ("connect" == e.type && "" == e.endpoint && this
									.onConnect(), "error" == e.type && "reconnect" == e.advice && (this
										.isOpen = !1), this.socket.onPacket(e), this)
						}, n.prototype.setCloseTimeout = function() {
							if (!this.closeTimeout) {
								var e = this;
								this.closeTimeout = setTimeout((function() {
									e.onDisconnect()
								}), this.socket.closeTimeout)
							}
						}, n.prototype.onDisconnect = function() {
							return this.isOpen && this.close(), this.clearTimeouts(), this.socket ? (
								this.socket.transport === this ? this.socket.onDisconnect() : this
								.socket.setBuffer(!1), this) : this
						}, n.prototype.onConnect = function() {
							return this.socket.onConnect(), this
						}, n.prototype.clearCloseTimeout = function() {
							this.closeTimeout && (clearTimeout(this.closeTimeout), this.closeTimeout =
								null)
						}, n.prototype.clearTimeouts = function() {
							this.clearCloseTimeout(), this.reopenTimeout && clearTimeout(this
								.reopenTimeout)
						}, n.prototype.packet = function(e) {
							this.send(t.parser.encodePacket(e))
						}, n.prototype.onHeartbeat = function(e) {
							this.packet({
								type: "heartbeat"
							})
						}, n.prototype.onOpen = function() {
							this.isOpen = !0, this.clearCloseTimeout(), this.socket.onOpen()
						}, n.prototype.onClose = function() {
							this.isOpen = !1, this.socket.transport === this ? this.socket.onClose() :
								this.socket.setBuffer(!1), this.onDisconnect(), this
								.onDisconnectDone instanceof Function && this.onDisconnectDone(null),
								this.onConnectionOver instanceof Function && this.onConnectionOver(null)
						}, n.prototype.onDisconnectDone = function() {}, n.prototype.onConnectionOver =
						function() {}, n.prototype.prepareUrl = function() {
							var e = this.socket.options;
							return this.scheme() + "://" + e.host + ":" + e.port + "/" + e.resource +
								"/" + t.protocol + "/" + this.name + "/" + this.sessid
						}, n.prototype.ready = function(e, t) {
							t.call(this)
						}
				}(void 0 !== io ? io : module.exports, void 0 !== io ? io : module.parent.exports),
				function(e, t, n) {
					function s(e) {
						if (this.options = {
								port: 80,
								secure: !1,
								document: "document" in n && document,
								resource: "socket.io",
								transports: e.transports || t.transports,
								"connect timeout": 1e4,
								"try multiple transports": !0,
								reconnect: !0,
								"reconnection delay": 500,
								"reconnection limit": 1 / 0,
								"reopen delay": 3e3,
								"max reconnection attempts": 10,
								"sync disconnect on unload": !1,
								"auto connect": !0,
								"flash policy port": 10843,
								manualFlush: !1
							}, t.util.merge(this.options, e), this.connected = !1, this.open = !1, this
							.connecting = !1, this.reconnecting = !1, this.namespaces = {}, this
							.buffer = [], this.doBuffer = !1, this.options[
							"sync disconnect on unload"] && (!this.isXDomain() || t.util.ua.hasCORS)) {
							var s = this;
							t.util.on(n, "beforeunload", (function() {
								s.disconnectSync()
							}), !1)
						}
						this.options["auto connect"] && this.connect()
					}

					function r() {}
					e.Socket = s, t.util.mixin(s, t.EventEmitter), s.prototype.of = function(e) {
						return this.namespaces[e] || (this.namespaces[e] = new t.SocketNamespace(
							this, e), "" !== e && this.namespaces[e].packet({
							type: "connect"
						})), this.namespaces[e]
					}, s.prototype.publish = function() {
						var e;
						for (var t in this.emit.apply(this, arguments), this.namespaces) this
							.namespaces.hasOwnProperty(t) && (e = this.of(t)).$emit.apply(e,
								arguments)
					}, s.prototype.handshake = function(e) {
						var n = this,
							s = this.options;
						var i = ["http" + (s.secure ? "s" : "") + ":/", s.host + ":" + s.port, s
								.resource, t.protocol, t.util.query(this.options.query, "t=" + +
									new Date)
							].join("/"),
							o = t.util.request();
						o.open("GET", i, !0), o.timeout = 1e4, this.isXDomain() && (o
							.withCredentials = !0), o.onreadystatechange = function() {
							var t;
							4 == o.readyState && (o.onreadystatechange = r, 200 == o.status ? (
									t = o.responseText) instanceof Error ? (n.connecting = !
									1, n.onError(t.message)) : e.apply(null, t.split(":")) :
								403 == o.status ? (n.connecting = !1, n.onError(o
									.responseText), n.publish("handshake_failed")) : (n
									.connecting = !1, !n.reconnecting && n.onError(o
										.responseText), n.publish("handshake_failed")))
						}, o.ontimeout = function(e) {
							n.connecting = !1, !n.reconnecting && n.onError(o.responseText), n
								.publish("handshake_failed")
						}, o.send(null)
					}, s.prototype.connect = function(e) {
						if (this.connecting) return this;
						var n = this;
						return n.connecting = !0, this.handshake((function(s, r, i, o) {
							n.sessionid = s, n.closeTimeout = 1e3 * i, n
								.heartbeatTimeout = 1e3 * r, n.transports || (n
									.transports = n.origTransports = o ? t.util
									.intersect(o.split(","), n.options.transports) : n
									.options.transports), n.setHeartbeatTimeout(), n
								.once("connect", (function() {
									clearTimeout(n.connectTimeoutTimer), n
										.connectTimeoutTimer = null, e &&
										"function" == typeof e && e()
								})), n.doConnect()
						})), this
					}, s.prototype.doConnect = function() {
						var e = this;
						if (e.transport && e.transport.clearTimeouts(), e.transport = e
							.getTransport(e.transports), !e.transport) return e.publish(
							"connect_failed");
						e.transport.ready(e, (function() {
							e.connecting = !0, e.publish("connecting", e.transport
								.name), e.transport.open(), e.options[
								"connect timeout"] && (e.connectTimeoutTimer &&
									clearTimeout(e.connectTimeoutTimer), e
									.connectTimeoutTimer = setTimeout(e.tryNextTransport
										.bind(e), e.options["connect timeout"]))
						}))
					}, s.prototype.getTransport = function(e) {
						for (var n, s = e || this.transports, r = 0; n = s[r]; r++) {
							if (t.Transport[n] && t.Transport[n].check(this) && (!this
								.isXDomain() || t.Transport[n].xdomainCheck(this))) return new t
								.Transport[n](this, this.sessionid)
						}
						return null
					}, s.prototype.tryNextTransport = function() {
						if (!this.connected && (this.connecting = !1, this.options[
								"try multiple transports"])) {
							for (var e = this.transports; e.length > 0 && e.splice(0, 1)[0] != this
								.transport.name;);
							e.length ? this.doConnect() : this.publish("connect_failed")
						}
					}, s.prototype.setHeartbeatTimeout = function() {
						if (clearTimeout(this.heartbeatTimeoutTimer), !this.transport || this
							.transport.heartbeats()) {
							var e = this;
							this.heartbeatTimeoutTimer = setTimeout((function() {
								e.transport && e.transport.onClose()
							}), this.heartbeatTimeout)
						}
					}, s.prototype.packet = function(e) {
						return this.connected && !this.doBuffer ? this.transport.packet(e) : this
							.buffer.push(e), this
					}, s.prototype.setBuffer = function(e) {
						this.doBuffer = e, !e && this.connected && this.buffer.length && (this
							.options.manualFlush || this.flushBuffer())
					}, s.prototype.flushBuffer = function() {
						this.transport.payload(this.buffer), this.buffer = []
					}, s.prototype.disconnect = function() {
						return (this.connected || this.connecting) && (this.open && this.of("")
							.packet({
								type: "disconnect"
							}), this.onDisconnect("booted")), this
					}, s.prototype.disconnectSync = function() {
						var e = t.util.request(),
							n = ["http" + (this.options.secure ? "s" : "") + ":/", this.options
								.host + ":" + this.options.port, this.options.resource, t.protocol,
								"", this.sessionid
							].join("/") + "/?disconnect=1";
						e.open("GET", n, !1), e.send(null), this.onDisconnect("booted")
					}, s.prototype.isXDomain = function() {
						var e = n && n.location || {},
							t = e.port || ("https:" == e.protocol ? 443 : 80);
						return this.options.host !== e.hostname || this.options.port != t
					}, s.prototype.onConnect = function() {
						this.connected || (this.connected = !0, this.connecting = !1, this
							.doBuffer || this.setBuffer(!1), this.emit("connect"))
					}, s.prototype.onOpen = function() {
						this.open = !0
					}, s.prototype.onClose = function() {
						this.open = !1, clearTimeout(this.heartbeatTimeoutTimer)
					}, s.prototype.onPacket = function(e) {
						this.of(e.endpoint).onPacket(e)
					}, s.prototype.onError = function(e) {
						e && e.advice && "reconnect" === e.advice && (this.connected || this
							.connecting) && (this.disconnect(), this.options.reconnect && this
							.reconnect()), this.publish("error", e && e.reason ? e.reason : e)
					}, s.prototype.onDisconnect = function(e) {
						var t = this.connected,
							n = this.connecting;
						this.connected = !1, this.connecting = !1, this.open = !1, (t || n) && (this
							.transport.close(), this.transport.clearTimeouts(), t && (this
								.publish("disconnect", e), "booted" != e && this.options
								.reconnect && !this.reconnecting && this.reconnect()), n && (
								this.connectTimeoutTimer && clearTimeout(this
									.connectTimeoutTimer), this.tryNextTransport()))
					}, s.prototype.reconnect = function() {
						this.reconnecting = !0, this.reconnectionAttempts = 0, this
							.reconnectionDelay = this.options["reconnection delay"];
						var e = this,
							t = this.options["max reconnection attempts"],
							n = this.options["try multiple transports"],
							s = this.options["reconnection limit"];

						function r() {
							if (e.connected) {
								for (var t in e.namespaces) e.namespaces.hasOwnProperty(t) && "" !==
									t && e.namespaces[t].packet({
										type: "connect"
									});
								e.publish("reconnect", e.transport.name, e.reconnectionAttempts)
							}
							clearTimeout(e.reconnectionTimer), e.removeListener("connect_failed",
								i), e.removeListener("connect", i), e.reconnecting = !1, delete e
								.reconnectionAttempts, delete e.reconnectionDelay, delete e
								.reconnectionTimer, delete e.redoTransports, e.options[
									"try multiple transports"] = n
						}

						function i() {
							if (e.reconnecting) return e.connected ? r() : e.connecting && e
								.reconnecting ? e.reconnectionTimer = setTimeout(i, 1e3) : void(
									e.reconnectionAttempts++ >= t ? e.redoTransports ? (e
										.publish("reconnect_failed"), r()) : (e.on(
											"connect_failed", i), e.options[
											"try multiple transports"] = !0, e.transports = e
										.origTransports, e.transport = e.getTransport(), e
										.redoTransports = !0, e.connect()) : (e
										.reconnectionDelay < s && (e.reconnectionDelay *= 2), e
										.connect(), e.publish("reconnecting", e
											.reconnectionDelay, e.reconnectionAttempts), e
										.reconnectionTimer = setTimeout(i, e.reconnectionDelay))
									)
						}
						this.options["try multiple transports"] = !1, this.reconnectionTimer =
							setTimeout(i, this.reconnectionDelay), this.on("connect", i)
					}
				}(void 0 !== io ? io : module.exports, void 0 !== io ? io : module.parent.exports,
				root),
				function(e, t) {
					function n(e, t) {
						this.socket = e, this.name = t || "", this.flags = {}, this.json = new s(this,
							"json"), this.ackPackets = 0, this.acks = {}
					}

					function s(e, t) {
						this.namespace = e, this.name = t
					}
					e.SocketNamespace = n, t.util.mixin(n, t.EventEmitter), n.prototype.$emit = t
						.EventEmitter.prototype.emit, n.prototype.of = function() {
							return this.socket.of.apply(this.socket, arguments)
						}, n.prototype.packet = function(e) {
							return e.endpoint = this.name, this.socket.packet(e), this.flags = {}, this
						}, n.prototype.send = function(e, t) {
							var n = {
								type: this.flags.json ? "json" : "message",
								data: e
							};
							return "function" == typeof t && (n.id = ++this.ackPackets, n.ack = !0, this
								.acks[n.id] = t), this.packet(n)
						}, n.prototype.emit = function(e) {
							var t = Array.prototype.slice.call(arguments, 1),
								n = t[t.length - 1],
								s = {
									type: "event",
									name: e
								};
							return "function" == typeof n && (s.id = ++this.ackPackets, s.ack = "data",
									this.acks[s.id] = n, t = t.slice(0, t.length - 1)), s.args = t, this
								.packet(s)
						}, n.prototype.disconnect = function() {
							return "" === this.name ? this.socket.disconnect() : (this.packet({
								type: "disconnect"
							}), this.$emit("disconnect")), this
						}, n.prototype.onPacket = function(e) {
							var n = this;

							function s() {
								n.packet({
									type: "ack",
									args: t.util.toArray(arguments),
									ackId: e.id
								})
							}
							switch (e.type) {
								case "connect":
									this.$emit("connect");
									break;
								case "disconnect":
									"" === this.name ? this.socket.onDisconnect(e.reason || "booted") :
										this.$emit("disconnect", e.reason);
									break;
								case "message":
								case "json":
									var r = ["message", e.data];
									"data" == e.ack ? r.push(s) : e.ack && this.packet({
										type: "ack",
										ackId: e.id
									}), this.$emit.apply(this, r);
									break;
								case "event":
									r = [e.name].concat(e.args);
									"data" == e.ack && r.push(s), this.$emit.apply(this, r);
									break;
								case "ack":
									this.acks[e.ackId] && (this.acks[e.ackId].apply(this, e.args),
										delete this.acks[e.ackId]);
									break;
								case "error":
									console.error("SocketIO on packet error: ", e), e.advice ? this
										.socket.onError(e) : "unauthorized" === e.reason ? this.$emit(
											"connect_failed", e.reason) : this.$emit("error", e.reason)
							}
						}, s.prototype.send = function() {
							this.namespace.flags[this.name] = !0, this.namespace.send.apply(this
								.namespace, arguments)
						}, s.prototype.emit = function() {
							this.namespace.flags[this.name] = !0, this.namespace.emit.apply(this
								.namespace, arguments)
						}
				}(void 0 !== io ? io : module.exports, void 0 !== io ? io : module.parent.exports),
				function(e, t, n) {
					function s(e) {
						t.Transport.apply(this, arguments)
					}
					e.websocket = s, t.util.inherit(s, t.Transport), s.prototype.name = "websocket", s
						.prototype.open = function() {
							var e, s = t.util.query(this.socket.options.query),
								r = this;
							return e || (e = n.MozWebSocket || n.WebSocket), this.websocket = new e(this
								.prepareUrl() + s), this.websocket.onopen = function() {
								r.onOpen(), r.socket.setBuffer(!1)
							}, this.websocket.onmessage = function(e) {
								r.onData(e.data)
							}, this.websocket.onclose = function() {
								r.socket.setBuffer(!0), r.onClose()
							}, this.websocket.onerror = function(e) {
								r.onError(e)
							}, this
						}, t.util.ua.iDevice ? s.prototype.send = function(e) {
							var t = this;
							return setTimeout((function() {
								t.websocket.send(e)
							}), 0), this
						} : s.prototype.send = function(e) {
							return this.websocket.send(e), this
						}, s.prototype.payload = function(e) {
							for (var t = 0, n = e.length; t < n; t++) this.packet(e[t]);
							return this
						}, s.prototype.close = function() {
							return this.websocket.close(), this
						}, s.prototype.onError = function(e) {
							this.socket.onError(e)
						}, s.prototype.scheme = function() {
							return this.socket.options.secure ? "wss" : "ws"
						}, s.check = function() {
							return "WebSocket" in n && !("__addTask" in WebSocket) || "MozWebSocket" in
								n
						}, s.xdomainCheck = function() {
							return !0
						}, t.transports.push("websocket")
				}(void 0 !== io ? io.Transport : module.exports, void 0 !== io ? io : module.parent
					.exports, root),
				function(e, t, n) {
					function s(e) {
						e && (t.Transport.apply(this, arguments), this.sendBuffer = [])
					}

					function r() {}
					e.XHR = s, t.util.inherit(s, t.Transport), s.prototype.open = function() {
						return this.socket.setBuffer(!1), this.onOpen(), this.get(), this
							.setCloseTimeout(), this
					}, s.prototype.payload = function(e) {
						for (var n = [], s = 0, r = e.length; s < r; s++) n.push(t.parser
							.encodePacket(e[s]));
						this.send(t.parser.encodePayload(n))
					}, s.prototype.send = function(e) {
						return this.post(e), this
					}, s.prototype.post = function(e) {
						var t = this;
						this.socket.setBuffer(!0), this.sendXHR = this.request("POST"), n
							.XDomainRequest && this.sendXHR instanceof XDomainRequest ? this.sendXHR
							.onload = this.sendXHR.onerror = function() {
								this.onload = r, t.socket.setBuffer(!1)
							} : this.sendXHR.onreadystatechange = function() {
								4 == this.readyState && (this.onreadystatechange = r, t.posting = !
									1, 200 == this.status ? t.socket.setBuffer(!1) : t.onClose()
									)
							}, this.sendXHR.send(e)
					}, s.prototype.close = function() {
						return this.onClose(), this
					}, s.prototype.request = function(e) {
						var n = t.util.request(this.socket.isXDomain()),
							s = t.util.query(this.socket.options.query, "t=" + +new Date);
						if (n.open(e || "GET", this.prepareUrl() + s, !0), "POST" == e) try {
							n.setRequestHeader ? n.setRequestHeader("Content-type",
								"text/plain;charset=UTF-8") : n.contentType = "text/plain"
						} catch (e) {}
						return n
					}, s.prototype.scheme = function() {
						return this.socket.options.secure ? "https" : "http"
					}, s.check = function(e, s) {
						try {
							var r = t.util.request(s),
								i = n.XDomainRequest && r instanceof XDomainRequest,
								o = e && e.options && e.options.secure ? "https:" : "http:",
								a = n.location && o != n.location.protocol;
							if (r && (!i || !a)) return !0
						} catch (e) {}
						return !1
					}, s.xdomainCheck = function(e) {
						return s.check(e, !0)
					}
				}(void 0 !== io ? io.Transport : module.exports, void 0 !== io ? io : module.parent
					.exports, root),
				function(e, t, n) {
					function s() {
						t.Transport.XHR.apply(this, arguments)
					}

					function r() {}
					e["xhr-polling"] = s, t.util.inherit(s, t.Transport.XHR), t.util.merge(s, t
							.Transport.XHR), s.prototype.name = "xhr-polling", s.prototype.heartbeats =
						function() {
							return !1
						}, s.prototype.open = function() {
							return t.Transport.XHR.prototype.open.call(this), !1
						}, s.prototype.get = function() {
							if (this.isOpen) {
								var e = this;
								this.xhr = this.request(), n.XDomainRequest && this
									.xhr instanceof XDomainRequest ? (this.xhr.onload = function() {
										this.onload = r, this.onerror = r, e.retryCounter = 1, e
											.onData(this.responseText), e.get()
									}, this.xhr.onerror = function() {
										e.retryCounter++, !e.retryCounter || e.retryCounter > 3 ? e
											.onClose() : e.get()
									}) : this.xhr.onreadystatechange = function() {
										4 == this.readyState && (this.onreadystatechange = r, 200 ==
											this.status ? (e.onData(this.responseText), e.get()) : e
											.onClose())
									}, this.xhr.send(null)
							}
						}, s.prototype.onClose = function() {
							if (t.Transport.XHR.prototype.onClose.call(this), this.xhr) {
								this.xhr.onreadystatechange = this.xhr.onload = this.xhr.onerror = r;
								try {
									this.xhr.abort()
								} catch (e) {}
								this.xhr = null
							}
						}, s.prototype.ready = function(e, n) {
							var s = this;
							t.util.defer((function() {
								n.call(s)
							}))
						}, t.transports.push("xhr-polling")
				}(void 0 !== io ? io.Transport : module.exports, void 0 !== io ? io : module.parent
					.exports, root), __WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ =
					function() {
						return io
					}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), void 0 ===
					__WEBPACK_AMD_DEFINE_RESULT__ || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)
			}()
	}).call(this, __webpack_require__(14), __webpack_require__(83)(module))
}, function(e, t, n) {
	var s = n(5);

	function r() {}
	r.typeMap = {
		text: 0,
		image: 1,
		audio: 2,
		video: 3,
		geo: 4,
		notification: 5,
		file: 6,
		tip: 10,
		robot: 11,
		g2: 12,
		custom: 100
	};
	let i = r.typeReverseMap = {
		0: "text",
		1: "image",
		2: "audio",
		3: "video",
		4: "geo",
		5: "notification",
		6: "file",
		10: "tip",
		11: "robot",
		12: "g2",
		100: "custom"
	};
	r.validTypes = Object.keys(r.typeMap), r.setFlow = (e, t) => {
		let n = t === e.from;
		n && t === e.to && (n = s.deviceId === e.fromDeviceId), e.flow = n ? "out" : "in", "robot" === e
			.type && e.content && e.content.msgOut && (e.flow = "in")
	}, r.getType = e => {
		let t = e.type;
		return i[t] || t
	}, e.exports = r
}, function(e, t, n) {
	"use strict";
	e.exports = function(e, t, n, s) {
		var r = self || window;
		try {
			try {
				var i;
				try {
					i = new r.Blob([e])
				} catch (t) {
					(i = new(r.BlobBuilder || r.WebKitBlobBuilder || r.MozBlobBuilder || r
						.MSBlobBuilder)).append(e), i = i.getBlob()
				}
				var o = r.URL || r.webkitURL,
					a = o.createObjectURL(i),
					c = new r[t](a, n);
				return o.revokeObjectURL(a), c
			} catch (s) {
				return new r[t]("data:application/javascript,".concat(encodeURIComponent(e)), n)
			}
		} catch (e) {
			if (!s) throw Error("Inline worker is not supported");
			return new r[t](s, n)
		}
	}
}, function(e, t, n) {
	n(56);
	const s = n(1);
	s.lbsUrl = s.lbsUrl.replace("/webconf.jsp", "/wxwebconf.jsp"), s.defaultReportUrl = null, s
		.isWeixinApp = !0
}, function(e, t, n) {
	var s = n(0),
		r = s.notundef,
		i = s.fillPropertyWithDefault,
		o = Object.keys,
		a = {},
		c = {},
		m = {},
		u = [],
		l = {
			normal: 0,
			advanced: 1
		},
		d = {
			0: "normal",
			1: "advanced"
		},
		p = a.joinMode = {
			noVerify: 0,
			needVerify: 1,
			rejectAll: 2
		};
	c.joinMode = {
		0: "noVerify",
		1: "needVerify",
		2: "rejectAll"
	}, m.joinMode = o(p), u.push("join");
	var g = a.beInviteMode = {
		needVerify: 0,
		noVerify: 1
	};

	function f(e) {
		s.verifyOptions(e, "action", "superTeam::SuperTeam"), s.verifyOptions(e, "teamId",
			"superTeam::SuperTeam"), r(e.teamId) && (this.teamId = e.teamId), r(e.type) && (this.type =
			l[e.type]), r(e.avatar) && (this.avatar = "" + e.avatar), r(e.name) && (this.name = "" + e
			.name), r(e.intro) && (this.intro = "" + e.intro), r(e.announcement) && (this.announcement =
			"" + e.announcement), r(e.custom) && (this.custom = "" + e.custom), u.forEach(this.setMode
			.bind(this, e))
	}

	function h(e, t) {
		r(e[t += "Mode"]) && (e[t] = c[t][e[t]])
	}
	c.beInviteMode = {
		0: "needVerify",
		1: "noVerify"
	}, u.push("beInvite"), m.beInviteMode = o(g), f.prototype.setMode = function(e, t) {
		r(e[t += "Mode"]) && (s.verifyParamValid(t, e[t], m[t], "Superteam::Team"), this[t] = a[t][e[
			t]])
	}, f.reverse = function(e, t) {
		var n = s.copy(e);
		if (r(n.teamId) && (n.teamId = "" + n.teamId), r(n.type) && (n.type = d[n.type]), r(n.level) &&
			(n.level = +n.level), r(n.valid) && (n.valid = 1 == +n.valid), r(n.memberNum) && (n
				.memberNum = +n.memberNum), r(n.memberUpdateTime) && (n.memberUpdateTime = +n
				.memberUpdateTime), r(n.createTime) && (n.createTime = +n.createTime), r(n
			.updateTime) && (n.updateTime = +n.updateTime), r(n.validToCurrentUser) && (n
				.validToCurrentUser = "1" === n.validToCurrentUser), r(n.mute) && (n.mute = "1" === n
				.mute), r(n.muteType)) switch (n.muteType) {
			case "0":
				n.mute = !1, n.muteType = "none";
				break;
			case "1":
				n.mute = !0, n.muteType = "normal";
				break;
			case "3":
				n.mute = !0, n.muteType = "all"
		} else r(n.mute) && (1 === n.mute ? (n.mute = !0, n.muteType = "normal") : (n.mute = !1, n
			.muteType = "none"));
		return u.forEach(h.bind(null, n)), delete n.bits, t || f.fillProperties(n), n
	}, f.fillProperties = function(e) {
		return i(e, "avatar", "")
	}, e.exports = f
}, function(e, t, n) {
	var s = n(0).notundef;

	function r(e) {
		s(e.shouldPushNotificationWhenPCOnline) && (this.open = e.shouldPushNotificationWhenPCOnline ? 2 :
			1)
	}
	r.getDefaultConfig = function() {
		return {
			shouldPushNotificationWhenPCOnline: !0
		}
	}, r.reverse = function(e) {
		return {
			shouldPushNotificationWhenPCOnline: 1 != +e.open
		}
	}, e.exports = r
}, function(e, t, n) {
	var s = n(0),
		r = n(24),
		i = s.merge({}, r.idMap, {
			auth: {
				id: 2,
				login: 3,
				kicked: 5,
				logout: 6,
				multiPortLogin: 7,
				kick: 8
			},
			user: {
				id: 3,
				updatePushToken: 1,
				appBackground: 2,
				markInBlacklist: 3,
				getBlacklist: 4,
				markInMutelist: 5,
				getMutelist: 6,
				getRelations: 8,
				getUsers: 7,
				updateMyInfo: 10,
				updateDonnop: 15,
				syncMyInfo: 109,
				syncUpdateMyInfo: 110
			},
			notify: {
				id: 4,
				markRead: 3,
				syncOfflineMsgs: 4,
				batchMarkRead: 5,
				syncOfflineSysMsgs: 6,
				syncOfflineNetcallMsgs: 8,
				syncRoamingMsgs: 9,
				syncMsgReceipts: 12,
				syncRobots: 15,
				syncBroadcastMsgs: 16,
				syncSuperTeamRoamingMsgs: 17,
				syncOfflineSuperTeamSysMsgs: 18,
				syncDeleteSuperTeamMsgOfflineRoaming: 19,
				syncDeleteMsgSelf: 21,
				syncSessionsWithMoreRoaming: 22,
				syncStickTopSessions: 23,
				syncSessionHistoryMsgsDelete: 24
			},
			sync: {
				id: 5,
				sync: 1,
				syncTeamMembers: 2,
				syncSuperTeamMembers: 3
			},
			msg: {
				id: 7,
				sendMsg: 1,
				msg: 2,
				sysMsg: 3,
				getHistoryMsgs: 6,
				sendCustomSysMsg: 7,
				searchHistoryMsgs: 8,
				deleteSessions: 9,
				getSessions: 10,
				syncSendMsg: 101,
				sendMsgReceipt: 11,
				msgReceipt: 12,
				deleteMsg: 13,
				msgDeleted: 14,
				markSessionAck: 16,
				markSessionAckBatch: 25,
				broadcastMsg: 17,
				clearServerHistoryMsgs: 18,
				getServerSessions: 19,
				getServerSession: 20,
				updateServerSession: 21,
				deleteServerSessions: 22,
				deleteMsgSelf: 23,
				deleteMsgSelfBatch: 24,
				msgFtsInServer: 26,
				msgFtsInServerByTiming: 27,
				onClearServerHistoryMsgs: 118,
				syncUpdateServerSession: 121,
				onDeleteMsgSelf: 123,
				onDeleteMsgSelfBatch: 124
			},
			msgExtend: {
				id: 23,
				getThreadMsgs: 1,
				getMsgsByIdServer: 2,
				addQuickComment: 3,
				deleteQuickComment: 4,
				onQuickComment: 5,
				onDeleteQuickComment: 6,
				getQuickComments: 7,
				addCollect: 8,
				deleteCollects: 9,
				updateCollect: 10,
				getCollects: 11,
				addStickTopSession: 12,
				deleteStickTopSession: 13,
				updateStickTopSession: 14,
				addMsgPin: 15,
				updateMsgPin: 16,
				deleteMsgPin: 17,
				onAddMsgPin: 18,
				onUpdateMsgPin: 19,
				onDeleteMsgPin: 20,
				getMsgPins: 21,
				syncAddQuickComment: 103,
				syncDeleteQuickComment: 104,
				syncAddStickTopSession: 112,
				syncDeleteStickTopSession: 113,
				syncUpdateStickTopSession: 114,
				syncAddMsgPin: 115,
				syncUpdateMsgPin: 116,
				syncDeleteMsgPin: 117
			},
			team: {
				id: 8,
				createTeam: 1,
				sendTeamMsg: 2,
				teamMsg: 3,
				teamMsgs: 4,
				addTeamMembers: 5,
				removeTeamMembers: 6,
				updateTeam: 7,
				leaveTeam: 8,
				getTeam: 9,
				getTeams: 10,
				getTeamMembers: 11,
				dismissTeam: 12,
				applyTeam: 13,
				passTeamApply: 14,
				rejectTeamApply: 15,
				addTeamManagers: 16,
				removeTeamManagers: 17,
				transferTeam: 18,
				updateInfoInTeam: 19,
				updateNickInTeam: 20,
				acceptTeamInvite: 21,
				rejectTeamInvite: 22,
				getTeamHistoryMsgs: 23,
				searchTeamHistoryMsgs: 24,
				updateMuteStateInTeam: 25,
				getMyTeamMembers: 26,
				getMutedTeamMembers: 27,
				sendTeamMsgReceipt: 28,
				getTeamMsgReads: 29,
				getTeamMsgReadAccounts: 30,
				notifyTeamMsgReads: 31,
				muteTeamAll: 32,
				getTeamMemberInvitorAccid: 33,
				getTeamsById: 34,
				syncMyTeamMembers: 126,
				syncTeams: 109,
				syncTeamMembers: 111,
				syncCreateTeam: 101,
				syncSendTeamMsg: 102,
				syncUpdateTeamMember: 119
			},
			superTeam: {
				id: 21,
				sendSuperTeamMsg: 2,
				superTeamMsg: 3,
				addSuperTeamMembers: 5,
				removeSuperTeamMembers: 6,
				leaveSuperTeam: 7,
				updateSuperTeam: 8,
				getSuperTeam: 9,
				getSuperTeams: 12,
				updateInfoInSuperTeam: 10,
				getMySuperTeamMembers: 11,
				getSuperTeamMembers: 13,
				getSuperTeamHistoryMsgs: 14,
				getSuperTeamMembersByJoinTime: 15,
				sendSuperTeamCustomSysMsg: 16,
				deleteSuperTeamMsg: 17,
				superTeamMsgDelete: 18,
				superTeamCustomSysMsg: 19,
				applySuperTeam: 20,
				passSuperTeamApply: 21,
				rejectSuperTeamApply: 22,
				acceptSuperTeamInvite: 23,
				rejectSuperTeamInvite: 24,
				markSuperTeamSessionAck: 25,
				addSuperTeamManagers: 26,
				removeSuperTeamManagers: 27,
				updateSuperTeamMute: 28,
				updateSuperTeamMembersMute: 29,
				updateNickInSuperTeam: 30,
				transferSuperTeam: 31,
				markSuperTeamSessionsAck: 32,
				getSuperTeamMembersByAccounts: 33,
				getMutedSuperTeamMembers: 34,
				syncMySuperTeamMembers: 111,
				syncSuperTeams: 109,
				syncSuperTeamMembers: 113,
				syncCreateSuperTeam: 101,
				syncSendSuperTeamMsg: 102,
				syncUpdateSuperTeamMember: 110,
				syncDeleteSuperTeamMsg: 117
			},
			friend: {
				id: 12,
				friendRequest: 1,
				syncFriendRequest: 101,
				deleteFriend: 2,
				syncDeleteFriend: 102,
				updateFriend: 3,
				syncUpdateFriend: 103,
				getFriends: 4
			},
			chatroom: {
				id: 13,
				getChatroomAddress: 1
			},
			filter: {
				id: 101,
				sendFilterMsg: 1,
				filterMsg: 2,
				filterSysMsg: 3,
				sendFilterCustomSysMsg: 7
			},
			eventService: {
				id: 14,
				publishEvent: 1,
				pushEvent: 2,
				subscribeEvent: 3,
				unSubscribeEventsByAccounts: 4,
				unSubscribeEventsByType: 5,
				querySubscribeEventsByAccounts: 6,
				querySubscribeEventsByType: 7,
				pushEvents: 9
			},
			proxyService: {
				id: 22,
				httpProxy: 1,
				onProxyMsg: 2
			},
			qchat: {
				id: 24,
				getQChatAddress: 1
			}
		}),
		o = s.merge({}, r.cmdConfig, {
			login: {
				sid: i.auth.id,
				cid: i.auth.login,
				params: [{
					type: "Property",
					name: "login"
				}]
			},
			logout: {
				sid: i.auth.id,
				cid: i.auth.logout
			},
			kick: {
				sid: i.auth.id,
				cid: i.auth.kick,
				params: [{
					type: "StrArray",
					name: "deviceIds"
				}]
			},
			updatePushToken: {
				sid: i.user.id,
				cid: i.user.updatePushToken,
				params: [{
					type: "String",
					name: "tokenName"
				}, {
					type: "String",
					name: "token"
				}, {
					type: "int",
					name: "pushkit"
				}]
			},
			appBackground: {
				sid: i.user.id,
				cid: i.user.appBackground,
				params: [{
					type: "bool",
					name: "isBackground"
				}, {
					type: "Int",
					name: "badge"
				}]
			},
			markInBlacklist: {
				sid: i.user.id,
				cid: i.user.markInBlacklist,
				params: [{
					type: "String",
					name: "account"
				}, {
					type: "bool",
					name: "isAdd"
				}]
			},
			getBlacklist: {
				sid: i.user.id,
				cid: i.user.getBlacklist,
				params: [{
					type: "long",
					name: "time"
				}]
			},
			markInMutelist: {
				sid: i.user.id,
				cid: i.user.markInMutelist,
				params: [{
					type: "String",
					name: "account"
				}, {
					type: "bool",
					name: "isAdd"
				}]
			},
			getMutelist: {
				sid: i.user.id,
				cid: i.user.getMutelist,
				params: [{
					type: "long",
					name: "time"
				}]
			},
			getRelations: {
				sid: i.user.id,
				cid: i.user.getRelations,
				params: [{
					type: "long",
					name: "timetag"
				}]
			},
			getUsers: {
				sid: i.user.id,
				cid: i.user.getUsers,
				params: [{
					type: "StrArray",
					name: "accounts"
				}]
			},
			updateMyInfo: {
				sid: i.user.id,
				cid: i.user.updateMyInfo,
				params: [{
					type: "Property",
					name: "user"
				}, {
					type: "Property",
					name: "antispamTag"
				}]
			},
			updateDonnop: {
				sid: i.user.id,
				cid: i.user.updateDonnop,
				params: [{
					type: "Property",
					name: "donnop"
				}]
			},
			markRead: {
				sid: i.notify.id,
				cid: i.notify.markRead,
				params: [{
					type: "long",
					name: "id"
				}, {
					type: "ph",
					name: "ph"
				}]
			},
			batchMarkRead: {
				sid: i.notify.id,
				cid: i.notify.batchMarkRead,
				params: [{
					type: "byte",
					name: "sid"
				}, {
					type: "byte",
					name: "cid"
				}, {
					type: "LongArray",
					name: "ids"
				}]
			},
			sync: {
				sid: i.sync.id,
				cid: i.sync.sync,
				params: [{
					type: "Property",
					name: "sync"
				}]
			},
			syncTeamMembers: {
				sid: i.sync.id,
				cid: i.sync.syncTeamMembers,
				params: [{
					type: "LongLongMap",
					name: "sync"
				}]
			},
			syncSuperTeamMembers: {
				sid: i.sync.id,
				cid: i.sync.syncSuperTeamMembers,
				params: [{
					type: "LongLongMap",
					name: "sync"
				}]
			},
			sendMsg: {
				sid: i.msg.id,
				cid: i.msg.sendMsg,
				params: [{
					type: "Property",
					name: "msg"
				}]
			},
			getHistoryMsgs: {
				sid: i.msg.id,
				cid: i.msg.getHistoryMsgs,
				params: [{
					type: "String",
					name: "to"
				}, {
					type: "long",
					name: "beginTime"
				}, {
					type: "long",
					name: "endTime"
				}, {
					type: "long",
					name: "lastMsgId"
				}, {
					type: "int",
					name: "limit"
				}, {
					type: "bool",
					name: "reverse"
				}, {
					type: "LongArray",
					name: "msgTypes"
				}]
			},
			sendCustomSysMsg: {
				sid: i.msg.id,
				cid: i.msg.sendCustomSysMsg,
				params: [{
					type: "Property",
					name: "sysMsg"
				}]
			},
			searchHistoryMsgs: {
				sid: i.msg.id,
				cid: i.msg.searchHistoryMsgs,
				params: [{
					type: "String",
					name: "to"
				}, {
					type: "long",
					name: "beginTime"
				}, {
					type: "long",
					name: "endTime"
				}, {
					type: "String",
					name: "keyword"
				}, {
					type: "int",
					name: "limit"
				}, {
					type: "bool",
					name: "reverse"
				}]
			},
			getSessions: {
				sid: i.msg.id,
				cid: i.msg.getSessions,
				params: [{
					type: "long",
					name: "time"
				}]
			},
			deleteSessions: {
				sid: i.msg.id,
				cid: i.msg.deleteSessions,
				params: [{
					type: "StrArray",
					name: "sessions"
				}]
			},
			sendMsgReceipt: {
				sid: i.msg.id,
				cid: i.msg.sendMsgReceipt,
				params: [{
					type: "Property",
					name: "msgReceipt"
				}]
			},
			deleteMsg: {
				sid: i.msg.id,
				cid: i.msg.deleteMsg,
				params: [{
					type: "Property",
					name: "sysMsg"
				}]
			},
			markSessionAck: {
				sid: i.msg.id,
				cid: i.msg.markSessionAck,
				params: [{
					type: "byte",
					name: "scene"
				}, {
					type: "String",
					name: "to"
				}, {
					type: "long",
					name: "timetag"
				}]
			},
			markSessionAckBatch: {
				sid: i.msg.id,
				cid: i.msg.markSessionAckBatch,
				params: [{
					type: "PropertyArray",
					name: "sessionAckTags",
					entity: "sessionAckTag"
				}]
			},
			clearServerHistoryMsgs: {
				sid: i.msg.id,
				cid: i.msg.clearServerHistoryMsgs,
				params: [{
					type: "Property",
					name: "clearMsgsParams"
				}]
			},
			clearServerHistoryMsgsWithSync: {
				sid: i.msg.id,
				cid: i.msg.clearServerHistoryMsgs,
				params: [{
					type: "Property",
					name: "clearMsgsParamsWithSync"
				}]
			},
			msgFtsInServer: {
				sid: i.msg.id,
				cid: i.msg.msgFtsInServer,
				params: [{
					type: "Property",
					name: "msgFullSearchRequestTag"
				}]
			},
			msgFtsInServerByTiming: {
				sid: i.msg.id,
				cid: i.msg.msgFtsInServerByTiming,
				params: [{
					type: "Property",
					name: "msgTimingFullSearchRequestTag"
				}]
			},
			onClearServerHistoryMsgs: {
				sid: i.msg.id,
				cid: i.msg.clearServerHistoryMsgs
			},
			getServerSessions: {
				sid: i.msg.id,
				cid: i.msg.getServerSessions,
				params: [{
					type: "Property",
					name: "sessionReqTag"
				}]
			},
			getServerSession: {
				sid: i.msg.id,
				cid: i.msg.getServerSession,
				params: [{
					type: "Property",
					name: "session"
				}]
			},
			updateServerSession: {
				sid: i.msg.id,
				cid: i.msg.updateServerSession,
				params: [{
					type: "Property",
					name: "session"
				}]
			},
			deleteServerSessions: {
				sid: i.msg.id,
				cid: i.msg.deleteServerSessions,
				params: [{
					type: "PropertyArray",
					name: "sessions",
					entity: "session"
				}]
			},
			deleteMsgSelf: {
				sid: i.msg.id,
				cid: i.msg.deleteMsgSelf,
				params: [{
					type: "Property",
					name: "deleteMsgSelfTag"
				}]
			},
			deleteMsgSelfBatch: {
				sid: i.msg.id,
				cid: i.msg.deleteMsgSelfBatch,
				params: [{
					type: "PropertyArray",
					name: "deleteMsgSelfTags",
					entity: "deleteMsgSelfTag"
				}]
			},
			onDeleteMsgSelf: {
				sid: i.msg.id,
				cid: i.msg.onDeleteMsgSelf
			},
			onDeleteMsgSelfBatch: {
				sid: i.msg.id,
				cid: i.msg.onDeleteMsgSelfBatch
			},
			sendSuperTeamMsg: {
				sid: i.superTeam.id,
				cid: i.superTeam.sendSuperTeamMsg,
				params: [{
					type: "Property",
					name: "msg"
				}]
			},
			addSuperTeamMembers: {
				sid: i.superTeam.id,
				cid: i.superTeam.addSuperTeamMembers,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "StrArray",
					name: "accounts"
				}, {
					type: "String",
					name: "ps"
				}]
			},
			removeSuperTeamMembers: {
				sid: i.superTeam.id,
				cid: i.superTeam.removeSuperTeamMembers,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "StrArray",
					name: "accounts"
				}]
			},
			leaveSuperTeam: {
				sid: i.superTeam.id,
				cid: i.superTeam.leaveSuperTeam,
				params: [{
					type: "long",
					name: "teamId"
				}]
			},
			updateSuperTeam: {
				sid: i.superTeam.id,
				cid: i.superTeam.updateSuperTeam,
				params: [{
					type: "Property",
					name: "team"
				}, {
					type: "Property",
					name: "antispamTag"
				}]
			},
			getSuperTeam: {
				sid: i.superTeam.id,
				cid: i.superTeam.getSuperTeam,
				params: [{
					type: "long",
					name: "teamId"
				}]
			},
			getSuperTeams: {
				sid: i.superTeam.id,
				cid: i.superTeam.getSuperTeams,
				params: [{
					type: "long",
					name: "timetag"
				}]
			},
			getSuperTeamMembers: {
				sid: i.superTeam.id,
				cid: i.superTeam.getSuperTeamMembers,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "long",
					name: "timetag"
				}]
			},
			updateInfoInSuperTeam: {
				sid: i.superTeam.id,
				cid: i.superTeam.updateInfoInSuperTeam,
				params: [{
					type: "Property",
					name: "superTeamMember"
				}]
			},
			getSuperTeamHistoryMsgs: {
				sid: i.superTeam.id,
				cid: i.superTeam.getSuperTeamHistoryMsgs,
				params: [{
					type: "long",
					name: "to"
				}, {
					type: "long",
					name: "beginTime"
				}, {
					type: "long",
					name: "endTime"
				}, {
					type: "long",
					name: "lastMsgId"
				}, {
					type: "int",
					name: "limit"
				}, {
					type: "bool",
					name: "reverse"
				}, {
					type: "LongArray",
					name: "msgTypes"
				}]
			},
			applySuperTeam: {
				sid: i.superTeam.id,
				cid: i.superTeam.applySuperTeam,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "String",
					name: "ps"
				}]
			},
			passSuperTeamApply: {
				sid: i.superTeam.id,
				cid: i.superTeam.passSuperTeamApply,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "String",
					name: "from"
				}]
			},
			rejectSuperTeamApply: {
				sid: i.superTeam.id,
				cid: i.superTeam.rejectSuperTeamApply,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "String",
					name: "from"
				}, {
					type: "String",
					name: "ps"
				}]
			},
			acceptSuperTeamInvite: {
				sid: i.superTeam.id,
				cid: i.superTeam.acceptSuperTeamInvite,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "String",
					name: "from"
				}]
			},
			rejectSuperTeamInvite: {
				sid: i.superTeam.id,
				cid: i.superTeam.rejectSuperTeamInvite,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "String",
					name: "from"
				}, {
					type: "String",
					name: "ps"
				}]
			},
			markSuperTeamSessionAck: {
				sid: i.superTeam.id,
				cid: i.superTeam.markSuperTeamSessionAck,
				params: [{
					type: "long",
					name: "to"
				}, {
					type: "long",
					name: "timetag"
				}]
			},
			addSuperTeamManagers: {
				sid: i.superTeam.id,
				cid: i.superTeam.addSuperTeamManagers,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "StrArray",
					name: "accounts"
				}]
			},
			removeSuperTeamManagers: {
				sid: i.superTeam.id,
				cid: i.superTeam.removeSuperTeamManagers,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "StrArray",
					name: "accounts"
				}]
			},
			updateSuperTeamMute: {
				sid: i.superTeam.id,
				cid: i.superTeam.updateSuperTeamMute,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "int",
					name: "mute"
				}]
			},
			updateSuperTeamMembersMute: {
				sid: i.superTeam.id,
				cid: i.superTeam.updateSuperTeamMembersMute,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "StrArray",
					name: "accounts"
				}, {
					type: "int",
					name: "mute"
				}]
			},
			updateNickInSuperTeam: {
				sid: i.superTeam.id,
				cid: i.superTeam.updateNickInSuperTeam,
				params: [{
					type: "Property",
					name: "superTeamMember"
				}]
			},
			transferSuperTeam: {
				sid: i.superTeam.id,
				cid: i.superTeam.transferSuperTeam,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "String",
					name: "account"
				}, {
					type: "bool",
					name: "leave"
				}]
			},
			markSuperTeamSessionsAck: {
				sid: i.superTeam.id,
				cid: i.superTeam.markSuperTeamSessionsAck,
				params: [{
					type: "PropertyArray",
					name: "sessionAckTags",
					entity: "sessionAckTag"
				}]
			},
			getSuperTeamMembersByJoinTime: {
				sid: i.superTeam.id,
				cid: i.superTeam.getSuperTeamMembersByJoinTime,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "long",
					name: "joinTime"
				}, {
					type: "int",
					name: "limit"
				}, {
					type: "bool",
					name: "reverse"
				}]
			},
			getSuperTeamMembersByAccounts: {
				sid: i.superTeam.id,
				cid: i.superTeam.getSuperTeamMembersByAccounts,
				params: [{
					type: "StrArray",
					name: "memberIds"
				}]
			},
			getMutedSuperTeamMembers: {
				sid: i.superTeam.id,
				cid: i.superTeam.getMutedSuperTeamMembers,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "long",
					name: "joinTime"
				}, {
					type: "int",
					name: "limit"
				}, {
					type: "bool",
					name: "reverse"
				}]
			},
			sendSuperTeamCustomSysMsg: {
				sid: i.superTeam.id,
				cid: i.superTeam.sendSuperTeamCustomSysMsg,
				params: [{
					type: "Property",
					name: "sysMsg"
				}]
			},
			deleteSuperTeamMsg: {
				sid: i.superTeam.id,
				cid: i.superTeam.deleteSuperTeamMsg,
				params: [{
					type: "Property",
					name: "sysMsg"
				}]
			},
			getMySuperTeamMembers: {
				sid: i.superTeam.id,
				cid: i.superTeam.getMySuperTeamMembers,
				params: [{
					type: "LongArray",
					name: "teamIds"
				}]
			},
			createTeam: {
				sid: i.team.id,
				cid: i.team.createTeam,
				params: [{
					type: "Property",
					name: "team"
				}, {
					type: "StrArray",
					name: "accounts"
				}, {
					type: "String",
					name: "ps"
				}, {
					type: "Property",
					name: "antispamTag"
				}]
			},
			sendTeamMsg: {
				sid: i.team.id,
				cid: i.team.sendTeamMsg,
				params: [{
					type: "Property",
					name: "msg"
				}]
			},
			addTeamMembers: {
				sid: i.team.id,
				cid: i.team.addTeamMembers,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "StrArray",
					name: "accounts"
				}, {
					type: "String",
					name: "ps"
				}, {
					type: "String",
					name: "attach"
				}]
			},
			removeTeamMembers: {
				sid: i.team.id,
				cid: i.team.removeTeamMembers,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "StrArray",
					name: "accounts"
				}]
			},
			updateTeam: {
				sid: i.team.id,
				cid: i.team.updateTeam,
				params: [{
					type: "Property",
					name: "team"
				}, {
					type: "Property",
					name: "antispamTag"
				}]
			},
			leaveTeam: {
				sid: i.team.id,
				cid: i.team.leaveTeam,
				params: [{
					type: "long",
					name: "teamId"
				}]
			},
			getTeam: {
				sid: i.team.id,
				cid: i.team.getTeam,
				params: [{
					type: "long",
					name: "teamId"
				}]
			},
			getTeams: {
				sid: i.team.id,
				cid: i.team.getTeams,
				params: [{
					type: "long",
					name: "timetag"
				}]
			},
			getTeamsById: {
				sid: i.team.id,
				cid: i.team.getTeamsById,
				params: [{
					type: "longArray",
					name: "teamIds"
				}]
			},
			getTeamMembers: {
				sid: i.team.id,
				cid: i.team.getTeamMembers,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "long",
					name: "timetag"
				}]
			},
			dismissTeam: {
				sid: i.team.id,
				cid: i.team.dismissTeam,
				params: [{
					type: "long",
					name: "teamId"
				}]
			},
			applyTeam: {
				sid: i.team.id,
				cid: i.team.applyTeam,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "String",
					name: "ps"
				}]
			},
			passTeamApply: {
				sid: i.team.id,
				cid: i.team.passTeamApply,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "String",
					name: "from"
				}]
			},
			rejectTeamApply: {
				sid: i.team.id,
				cid: i.team.rejectTeamApply,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "String",
					name: "from"
				}, {
					type: "String",
					name: "ps"
				}]
			},
			addTeamManagers: {
				sid: i.team.id,
				cid: i.team.addTeamManagers,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "StrArray",
					name: "accounts"
				}]
			},
			removeTeamManagers: {
				sid: i.team.id,
				cid: i.team.removeTeamManagers,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "StrArray",
					name: "accounts"
				}]
			},
			transferTeam: {
				sid: i.team.id,
				cid: i.team.transferTeam,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "String",
					name: "account"
				}, {
					type: "bool",
					name: "leave"
				}]
			},
			updateInfoInTeam: {
				sid: i.team.id,
				cid: i.team.updateInfoInTeam,
				params: [{
					type: "Property",
					name: "teamMember"
				}]
			},
			updateNickInTeam: {
				sid: i.team.id,
				cid: i.team.updateNickInTeam,
				params: [{
					type: "Property",
					name: "teamMember"
				}]
			},
			acceptTeamInvite: {
				sid: i.team.id,
				cid: i.team.acceptTeamInvite,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "String",
					name: "from"
				}]
			},
			rejectTeamInvite: {
				sid: i.team.id,
				cid: i.team.rejectTeamInvite,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "String",
					name: "from"
				}, {
					type: "String",
					name: "ps"
				}]
			},
			getTeamHistoryMsgs: {
				sid: i.team.id,
				cid: i.team.getTeamHistoryMsgs,
				params: [{
					type: "long",
					name: "to"
				}, {
					type: "long",
					name: "beginTime"
				}, {
					type: "long",
					name: "endTime"
				}, {
					type: "long",
					name: "lastMsgId"
				}, {
					type: "int",
					name: "limit"
				}, {
					type: "bool",
					name: "reverse"
				}, {
					type: "LongArray",
					name: "msgTypes"
				}]
			},
			searchTeamHistoryMsgs: {
				sid: i.team.id,
				cid: i.team.searchTeamHistoryMsgs,
				params: [{
					type: "long",
					name: "to"
				}, {
					type: "long",
					name: "beginTime"
				}, {
					type: "long",
					name: "endTime"
				}, {
					type: "String",
					name: "keyword"
				}, {
					type: "int",
					name: "limit"
				}, {
					type: "bool",
					name: "reverse"
				}]
			},
			updateMuteStateInTeam: {
				sid: i.team.id,
				cid: i.team.updateMuteStateInTeam,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "String",
					name: "account"
				}, {
					type: "int",
					name: "mute"
				}]
			},
			getMyTeamMembers: {
				sid: i.team.id,
				cid: i.team.getMyTeamMembers,
				params: [{
					type: "LongArray",
					name: "teamIds"
				}]
			},
			getMutedTeamMembers: {
				sid: i.team.id,
				cid: i.team.getMutedTeamMembers,
				params: [{
					type: "long",
					name: "teamId"
				}]
			},
			sendTeamMsgReceipt: {
				sid: i.team.id,
				cid: i.team.sendTeamMsgReceipt,
				params: [{
					type: "PropertyArray",
					name: "teamMsgReceipts",
					entity: "teamMsgReceipt"
				}]
			},
			getTeamMsgReads: {
				sid: i.team.id,
				cid: i.team.getTeamMsgReads,
				params: [{
					type: "PropertyArray",
					name: "teamMsgReceipts",
					entity: "teamMsgReceipt"
				}]
			},
			getTeamMsgReadAccounts: {
				sid: i.team.id,
				cid: i.team.getTeamMsgReadAccounts,
				params: [{
					type: "Property",
					name: "teamMsgReceipt"
				}]
			},
			muteTeamAll: {
				sid: i.team.id,
				cid: i.team.muteTeamAll,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "int",
					name: "mute"
				}]
			},
			getTeamMemberInvitorAccid: {
				sid: i.team.id,
				cid: i.team.getTeamMemberInvitorAccid,
				params: [{
					type: "long",
					name: "teamId"
				}, {
					type: "StrArray",
					name: "accounts"
				}]
			},
			friendRequest: {
				sid: i.friend.id,
				cid: i.friend.friendRequest,
				params: [{
					type: "String",
					name: "account"
				}, {
					type: "byte",
					name: "type"
				}, {
					type: "String",
					name: "ps"
				}]
			},
			deleteFriend: {
				sid: i.friend.id,
				cid: i.friend.deleteFriend,
				params: [{
					type: "String",
					name: "account"
				}, {
					type: "Property",
					name: "delFriendParams"
				}]
			},
			updateFriend: {
				sid: i.friend.id,
				cid: i.friend.updateFriend,
				params: [{
					type: "Property",
					name: "friend"
				}]
			},
			getFriends: {
				sid: i.friend.id,
				cid: i.friend.getFriends,
				params: [{
					type: "long",
					name: "timetag"
				}]
			},
			getChatroomAddress: {
				sid: i.chatroom.id,
				cid: i.chatroom.getChatroomAddress,
				params: [{
					type: "long",
					name: "chatroomId"
				}, {
					type: "bool",
					name: "isWeixinApp"
				}, {
					type: "number",
					name: "type"
				}]
			},
			sendFilterMsg: {
				sid: i.filter.id,
				cid: i.filter.sendFilterMsg,
				params: [{
					type: "Property",
					name: "msg"
				}]
			},
			sendFilterCustomSysMsg: {
				sid: i.filter.id,
				cid: i.filter.sendFilterCustomSysMsg,
				params: [{
					type: "Property",
					name: "sysMsg"
				}]
			},
			publishEvent: {
				sid: i.eventService.id,
				cid: i.eventService.publishEvent,
				params: [{
					type: "Property",
					name: "msgEvent"
				}]
			},
			pushEvent: {
				sid: i.eventService.id,
				cid: i.eventService.pushEvent
			},
			subscribeEvent: {
				sid: i.eventService.id,
				cid: i.eventService.subscribeEvent,
				params: [{
					type: "Property",
					name: "msgEventSubscribe"
				}, {
					type: "StrArray",
					name: "accounts"
				}]
			},
			unSubscribeEventsByAccounts: {
				sid: i.eventService.id,
				cid: i.eventService.unSubscribeEventsByAccounts,
				params: [{
					type: "Property",
					name: "msgEventSubscribe"
				}, {
					type: "StrArray",
					name: "accounts"
				}]
			},
			unSubscribeEventsByType: {
				sid: i.eventService.id,
				cid: i.eventService.unSubscribeEventsByType,
				params: [{
					type: "Property",
					name: "msgEventSubscribe"
				}]
			},
			querySubscribeEventsByAccounts: {
				sid: i.eventService.id,
				cid: i.eventService.querySubscribeEventsByAccounts,
				params: [{
					type: "Property",
					name: "msgEventSubscribe"
				}, {
					type: "StrArray",
					name: "accounts"
				}]
			},
			querySubscribeEventsByType: {
				sid: i.eventService.id,
				cid: i.eventService.querySubscribeEventsByType,
				params: [{
					type: "Property",
					name: "msgEventSubscribe"
				}]
			},
			pushEvents: {
				sid: i.eventService.id,
				cid: i.eventService.pushEvents
			},
			getThreadMsgs: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.getThreadMsgs,
				params: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "threadMsgReq"
				}]
			},
			getMsgsByIdServer: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.getMsgsByIdServer,
				params: [{
					type: "PropertyArray",
					name: "reqMsgs",
					entity: "msg"
				}]
			},
			addQuickComment: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.addQuickComment,
				params: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "comment"
				}]
			},
			deleteQuickComment: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.deleteQuickComment,
				params: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "comment"
				}]
			},
			getQuickComments: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.getQuickComments,
				params: [{
					type: "PropertyArray",
					name: "commentReq",
					entity: "commentReq"
				}]
			},
			addCollect: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.addCollect,
				params: [{
					type: "Property",
					name: "collect"
				}]
			},
			deleteCollects: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.deleteCollects,
				params: [{
					type: "PropertyArray",
					name: "collectList",
					entity: "collect"
				}]
			},
			updateCollect: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.updateCollect,
				params: [{
					type: "Property",
					name: "collect"
				}]
			},
			getCollects: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.getCollects,
				params: [{
					type: "Property",
					name: "collectQuery"
				}]
			},
			addStickTopSession: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.addStickTopSession,
				params: [{
					type: "Property",
					name: "stickTopSession"
				}]
			},
			updateStickTopSession: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.updateStickTopSession,
				params: [{
					type: "Property",
					name: "stickTopSession"
				}]
			},
			deleteStickTopSession: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.deleteStickTopSession,
				params: [{
					type: "Property",
					name: "stickTopSession"
				}]
			},
			addMsgPin: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.addMsgPin,
				params: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "pinTag"
				}]
			},
			updateMsgPin: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.updateMsgPin,
				params: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "pinTag"
				}]
			},
			deleteMsgPin: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.deleteMsgPin,
				params: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "pinTag"
				}]
			},
			getMsgPins: {
				sid: i.msgExtend.id,
				cid: i.msgExtend.getMsgPins,
				params: [{
					type: "Property",
					name: "msgPinReq"
				}]
			},
			httpProxy: {
				sid: i.proxyService.id,
				cid: i.proxyService.httpProxy,
				params: [{
					type: "Property",
					name: "proxyTag"
				}]
			},
			getQChatAddress: {
				sid: i.qchat.id,
				cid: i.qchat.getQChatAddress,
				params: [{
					type: "Property",
					name: "getQChatAddressTag"
				}]
			}
		}),
		a = s.merge({}, r.packetConfig, {
			"2_3": {
				service: "auth",
				cmd: "login",
				response: [{
					type: "Property",
					name: "loginRes"
				}, {
					type: "PropertyArray",
					name: "loginPorts",
					entity: "loginPort"
				}, {
					type: "Property",
					name: "aosPushInfo"
				}]
			},
			"2_5": {
				service: "auth",
				cmd: "kicked",
				response: [{
					type: "Number",
					name: "from"
				}, {
					type: "Number",
					name: "reason"
				}, {
					type: "String",
					name: "custom"
				}, {
					type: "Number",
					name: "customClientType"
				}]
			},
			"2_6": {
				service: "auth",
				cmd: "logout"
			},
			"2_7": {
				service: "auth",
				cmd: "multiPortLogin",
				response: [{
					type: "Number",
					name: "state"
				}, {
					type: "PropertyArray",
					name: "loginPorts",
					entity: "loginPort"
				}]
			},
			"2_8": {
				service: "auth",
				cmd: "kick",
				response: [{
					type: "StrArray",
					name: "deviceIds"
				}]
			},
			"3_1": {
				service: "user",
				cmd: "updatePushToken"
			},
			"3_2": {
				service: "user",
				cmd: "appBackground"
			},
			"3_3": {
				service: "user",
				cmd: "markInBlacklist"
			},
			"3_103": {
				service: "user",
				cmd: "syncMarkInBlacklist",
				response: [{
					type: "String",
					name: "account"
				}, {
					type: "Boolean",
					name: "isAdd"
				}]
			},
			"3_4": {
				service: "user",
				cmd: "getBlacklist",
				response: [{
					type: "StrArray",
					name: "blacklist"
				}]
			},
			"3_5": {
				service: "user",
				cmd: "markInMutelist"
			},
			"3_105": {
				service: "user",
				cmd: "syncMarkInMutelist",
				response: [{
					type: "String",
					name: "account"
				}, {
					type: "Boolean",
					name: "isAdd"
				}]
			},
			"3_6": {
				service: "user",
				cmd: "getMutelist",
				response: [{
					type: "StrArray",
					name: "mutelist"
				}]
			},
			"3_8": {
				service: "user",
				cmd: "getRelations",
				response: [{
					type: "PropertyArray",
					name: "specialRelations",
					entity: "specialRelation"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"3_7": {
				service: "user",
				cmd: "getUsers",
				response: [{
					type: "PropertyArray",
					name: "users",
					entity: "user"
				}]
			},
			"3_10": {
				service: "user",
				cmd: "updateMyInfo",
				response: [{
					type: "Number",
					name: "timetag"
				}]
			},
			"3_15": {
				service: "user",
				cmd: "updateDonnop",
				response: [{
					type: "Number",
					name: "timetag"
				}]
			},
			"3_115": {
				service: "user",
				cmd: "syncUpdateDonnop",
				response: [{
					type: "Property",
					name: "donnop"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"3_109": {
				service: "user",
				cmd: "syncMyInfo",
				response: [{
					type: "Property",
					name: "user"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"3_110": {
				service: "user",
				cmd: "syncUpdateMyInfo",
				response: [{
					type: "Property",
					name: "user"
				}]
			},
			"4_1": {
				service: "notify"
			},
			"4_2": {
				service: "notify"
			},
			"4_3": {
				service: "notify",
				cmd: "markRead"
			},
			"4_4": {
				service: "notify",
				cmd: "syncOfflineMsgs",
				response: [{
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"4_5": {
				service: "notify",
				cmd: "batchMarkRead"
			},
			"4_6": {
				service: "notify",
				cmd: "syncOfflineSysMsgs",
				response: [{
					type: "PropertyArray",
					name: "sysMsgs",
					entity: "sysMsg"
				}]
			},
			"4_8": {
				service: "notify",
				cmd: "syncOfflineNetcallMsgs",
				response: [{
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"4_9": {
				service: "notify",
				cmd: "syncRoamingMsgs",
				response: [{
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"4_12": {
				service: "notify",
				cmd: "syncMsgReceipts",
				response: [{
					type: "PropertyArray",
					name: "msgReceipts",
					entity: "msgReceipt"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"4_13": {
				service: "notify",
				cmd: "syncDonnop",
				response: [{
					type: "Property",
					name: "donnop"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"4_14": {
				service: "notify",
				cmd: "syncSessionAck",
				response: [{
					type: "StrLongMap",
					name: "p2p"
				}, {
					type: "LongLongMap",
					name: "team"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"4_15": {
				service: "notify",
				cmd: "syncRobots",
				response: [{
					type: "PropertyArray",
					name: "robots",
					entity: "robot"
				}]
			},
			"4_16": {
				service: "notify",
				cmd: "syncBroadcastMsgs",
				response: [{
					type: "PropertyArray",
					name: "broadcastMsgs",
					entity: "broadcastMsg"
				}]
			},
			"4_17": {
				service: "notify",
				cmd: "syncSuperTeamRoamingMsgs",
				response: [{
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"4_18": {
				service: "notify",
				cmd: "syncOfflineSuperTeamSysMsgs",
				response: [{
					type: "PropertyArray",
					name: "sysMsgs",
					entity: "sysMsg"
				}]
			},
			"4_19": {
				service: "notify",
				cmd: "syncDeleteSuperTeamMsgOfflineRoaming",
				response: [{
					type: "PropertyArray",
					name: "sysMsgs",
					entity: "sysMsg"
				}, {
					type: "Number",
					name: "timetag"
				}, {
					type: "Number",
					name: "type"
				}]
			},
			"4_20": {
				service: "notify",
				cmd: "syncSuperTeamSessionAck",
				response: [{
					type: "LongLongMap",
					name: "superTeam"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"4_21": {
				service: "notify",
				cmd: "syncDeleteMsgSelf",
				response: [{
					type: "PropertyArray",
					name: "deletedMsgs",
					entity: "deleteMsgSelfTag"
				}]
			},
			"4_22": {
				service: "notify",
				cmd: "syncSessionsWithMoreRoaming",
				response: [{
					type: "PropertyArray",
					name: "sessions",
					entity: "msg"
				}]
			},
			"4_23": {
				service: "notify",
				cmd: "syncStickTopSessions",
				response: [{
					type: "Number",
					name: "timetag"
				}, {
					type: "boolean",
					name: "modify"
				}, {
					type: "PropertyArray",
					name: "sessions",
					entity: "stickTopSession"
				}]
			},
			"4_24": {
				service: "notify",
				cmd: "syncSessionHistoryMsgsDelete",
				response: [{
					type: "PropertyArray",
					name: "sessionHistoryMsgsDeleteTags",
					entity: "clearMsgsParamsWithSync"
				}]
			},
			"4_100": {
				service: "notify",
				cmd: "syncOfflineFilterMsgs",
				response: [{
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"4_101": {
				service: "notify",
				cmd: "syncOfflineFilterSysMsgs",
				response: [{
					type: "PropertyArray",
					name: "sysMsgs",
					entity: "sysMsg"
				}]
			},
			"5_1": {
				service: "sync",
				cmd: "syncDone",
				response: [{
					type: "Number",
					name: "timetag"
				}]
			},
			"5_2": {
				service: "sync",
				cmd: "syncTeamMembersDone",
				response: [{
					type: "Number",
					name: "timetag"
				}]
			},
			"5_3": {
				service: "sync",
				cmd: "syncSuperTeamMembersDone",
				response: [{
					type: "Number",
					name: "timetag"
				}]
			},
			"7_1": {
				service: "msg",
				cmd: "sendMsg",
				response: [{
					type: "Property",
					name: "msg"
				}],
				trivialErrorCodes: [7101]
			},
			"7_2": {
				service: "msg",
				cmd: "msg",
				response: [{
					type: "Property",
					name: "msg"
				}]
			},
			"7_3": {
				service: "msg",
				cmd: "sysMsg",
				response: [{
					type: "Property",
					name: "sysMsg"
				}]
			},
			"7_6": {
				service: "msg",
				cmd: "getHistoryMsgs",
				response: [{
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"7_7": {
				service: "msg",
				cmd: "sendCustomSysMsg",
				trivialErrorCodes: [7101]
			},
			"7_8": {
				service: "msg",
				cmd: "searchHistoryMsgs",
				response: [{
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"7_9": {
				service: "msg",
				cmd: "deleteSessions"
			},
			"7_10": {
				service: "msg",
				cmd: "getSessions",
				response: [{
					type: "StrArray",
					name: "sessions"
				}]
			},
			"7_101": {
				service: "msg",
				cmd: "syncSendMsg",
				response: [{
					type: "Property",
					name: "msg"
				}]
			},
			"7_11": {
				service: "msg",
				cmd: "sendMsgReceipt",
				response: [{
					type: "Property",
					name: "msgReceipt"
				}]
			},
			"7_12": {
				service: "msg",
				cmd: "msgReceipt",
				response: [{
					type: "Property",
					name: "msgReceipt"
				}]
			},
			"7_13": {
				service: "msg",
				cmd: "onDeleteMsg"
			},
			"7_14": {
				service: "msg",
				cmd: "onMsgDeleted",
				response: [{
					type: "Property",
					name: "sysMsg"
				}]
			},
			"7_15": {
				service: "msg",
				cmd: "onDeleteMsgOfflineRoaming",
				response: [{
					type: "PropertyArray",
					name: "sysMsgs",
					entity: "sysMsg"
				}, {
					type: "Number",
					name: "timetag"
				}, {
					type: "Number",
					name: "type"
				}]
			},
			"7_16": {
				service: "msg",
				cmd: "onMarkSessionAck"
			},
			"7_17": {
				service: "msg",
				cmd: "broadcastMsg",
				response: [{
					type: "Property",
					name: "broadcastMsg"
				}]
			},
			"7_18": {
				service: "msg",
				cmd: "clearServerHistoryMsgs",
				response: [{
					type: "Long",
					name: "timetag"
				}]
			},
			"7_19": {
				service: "session",
				cmd: "getServerSessions",
				response: [{
					type: "Property",
					name: "sessionReqTag"
				}, {
					type: "PropertyArray",
					name: "sessionList",
					entity: "session"
				}]
			},
			"7_20": {
				service: "session",
				cmd: "getServerSession",
				response: [{
					type: "Property",
					name: "session"
				}]
			},
			"7_21": {
				service: "session",
				cmd: "updateServerSession"
			},
			"7_22": {
				service: "session",
				cmd: "deleteServerSessions"
			},
			"7_23": {
				service: "msg",
				cmd: "deleteMsgSelf",
				response: [{
					type: "Long",
					name: "timetag"
				}]
			},
			"7_24": {
				service: "msg",
				cmd: "deleteMsgSelfBatch",
				response: [{
					type: "Long",
					name: "timetag"
				}]
			},
			"7_25": {
				service: "msg",
				cmd: "onMarkSessionAckBatch"
			},
			"7_26": {
				service: "msg",
				cmd: "msgFtsInServer",
				response: [{
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"7_27": {
				service: "msg",
				cmd: "msgFtsInServerByTiming",
				response: [{
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"7_118": {
				service: "msg",
				cmd: "onClearServerHistoryMsgs",
				response: [{
					type: "Property",
					name: "sessionHistoryMsgsDeleteTag",
					entity: "clearMsgsParamsWithSync"
				}]
			},
			"7_123": {
				service: "msg",
				cmd: "onDeleteMsgSelf",
				response: [{
					type: "Property",
					name: "deleteMsgSelfTag"
				}]
			},
			"7_124": {
				service: "msg",
				cmd: "onDeleteMsgSelfBatch",
				response: [{
					type: "PropertyArray",
					name: "deleteMsgSelfTags",
					entity: "deleteMsgSelfTag"
				}]
			},
			"7_116": {
				service: "msg",
				cmd: "syncMarkSessionAck",
				response: [{
					type: "Number",
					name: "scene"
				}, {
					type: "String",
					name: "to"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"7_121": {
				service: "msg",
				cmd: "syncUpdateServerSession",
				response: [{
					type: "Property",
					name: "session"
				}]
			},
			"23_1": {
				service: "msgExtend",
				cmd: "getThreadMsgs",
				response: [{
					type: "Property",
					name: "threadMsg",
					entity: "msg"
				}, {
					type: "Property",
					name: "threadMsgsMeta"
				}, {
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"23_2": {
				service: "msgExtend",
				cmd: "getMsgsByIdServer",
				response: [{
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"23_3": {
				service: "msgExtend",
				cmd: "addQuickComment",
				response: [{
					type: "Number",
					name: "timetag"
				}]
			},
			"23_4": {
				service: "msgExtend",
				cmd: "deleteQuickComment",
				response: [{
					type: "Number",
					name: "timetag"
				}]
			},
			"23_5": {
				service: "msgExtend",
				cmd: "onQuickComment",
				response: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "comment"
				}]
			},
			"23_6": {
				service: "msgExtend",
				cmd: "onDeleteQuickComment",
				response: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "comment"
				}]
			},
			"23_7": {
				service: "msgExtend",
				cmd: "getQuickComments",
				response: [{
					type: "PropertyArray",
					name: "commentRes",
					entity: "commentRes"
				}]
			},
			"23_8": {
				service: "msgExtend",
				cmd: "addCollect",
				response: [{
					type: "Property",
					name: "collect"
				}]
			},
			"23_9": {
				service: "msgExtend",
				cmd: "deleteCollects",
				response: [{
					type: "Number",
					name: "deleteNum"
				}]
			},
			"23_10": {
				service: "msgExtend",
				cmd: "updateCollect",
				response: [{
					type: "Property",
					name: "collect"
				}]
			},
			"23_11": {
				service: "msgExtend",
				cmd: "getCollects",
				response: [{
					type: "Number",
					name: "total"
				}, {
					type: "PropertyArray",
					name: "collectList",
					entity: "collect"
				}]
			},
			"23_12": {
				service: "msgExtend",
				cmd: "addStickTopSession",
				response: [{
					type: "Property",
					name: "stickTopSession"
				}]
			},
			"23_13": {
				service: "msgExtend",
				cmd: "deleteStickTopSession",
				response: [{
					type: "Number",
					name: "timetag"
				}]
			},
			"23_14": {
				service: "msgExtend",
				cmd: "updateStickTopSession",
				response: [{
					type: "Property",
					name: "stickTopSession"
				}]
			},
			"23_15": {
				service: "msgExtend",
				cmd: "addMsgPin",
				response: [{
					type: "Number",
					name: "timetag"
				}]
			},
			"23_16": {
				service: "msgExtend",
				cmd: "updateMsgPin",
				response: [{
					type: "Number",
					name: "timetag"
				}]
			},
			"23_17": {
				service: "msgExtend",
				cmd: "deleteMsgPin",
				response: [{
					type: "Number",
					name: "timetag"
				}]
			},
			"23_18": {
				service: "msgExtend",
				cmd: "onAddMsgPin",
				response: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "pinTag"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"23_19": {
				service: "msgExtend",
				cmd: "onUpdateMsgPin",
				response: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "pinTag"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"23_20": {
				service: "msgExtend",
				cmd: "onDeleteMsgPin",
				response: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "pinTag"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"23_21": {
				service: "msgExtend",
				cmd: "getMsgPins",
				response: [{
					type: "Number",
					name: "timetag"
				}, {
					type: "Boolean",
					name: "modify"
				}, {
					type: "PropertyArray",
					name: "pins",
					entity: "msgPinRes"
				}]
			},
			"23_103": {
				service: "msgExtend",
				cmd: "syncAddQuickComment",
				response: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "comment"
				}]
			},
			"23_104": {
				service: "msgExtend",
				cmd: "syncDeleteQuickComment",
				response: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "comment"
				}]
			},
			"23_112": {
				service: "msgExtend",
				cmd: "syncAddStickTopSession",
				response: [{
					type: "Property",
					name: "stickTopSession"
				}]
			},
			"23_113": {
				service: "msgExtend",
				cmd: "syncDeleteStickTopSession",
				response: [{
					type: "Number",
					name: "timetag"
				}, {
					type: "Property",
					name: "stickTopSession"
				}]
			},
			"23_114": {
				service: "msgExtend",
				cmd: "syncUpdateStickTopSession",
				response: [{
					type: "Property",
					name: "stickTopSession"
				}]
			},
			"23_115": {
				service: "msgExtend",
				cmd: "syncAddMsgPin",
				response: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "pinTag"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"23_116": {
				service: "msgExtend",
				cmd: "syncUpdateMsgPin",
				response: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "pinTag"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"23_117": {
				service: "msgExtend",
				cmd: "syncDeleteMsgPin",
				response: [{
					type: "Property",
					name: "msg"
				}, {
					type: "Property",
					name: "pinTag"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"21_2": {
				service: "superTeam",
				cmd: "sendSuperTeamMsg",
				response: [{
					type: "Property",
					name: "msg"
				}]
			},
			"21_3": {
				service: "superTeam",
				cmd: "superTeamMsg",
				response: [{
					type: "Property",
					name: "msg"
				}]
			},
			"21_5": {
				service: "superTeam",
				cmd: "addSuperTeamMembers",
				response: [{
					type: "StrArray",
					name: "abortedAccidList"
				}, {
					type: "long",
					name: "timetag"
				}]
			},
			"21_6": {
				service: "superTeam",
				cmd: "removeSuperTeamMembers"
			},
			"21_7": {
				service: "superTeam",
				cmd: "leaveSuperTeam"
			},
			"21_8": {
				service: "superTeam",
				cmd: "updateSuperTeam",
				response: [{
					type: "long",
					name: "teamId"
				}, {
					type: "long",
					name: "timetag"
				}]
			},
			"21_9": {
				service: "superTeam",
				cmd: "getSuperTeam",
				response: [{
					type: "Property",
					name: "team"
				}]
			},
			"21_12": {
				service: "superTeam",
				cmd: "getSuperTeams",
				response: [{
					type: "PropertyArray",
					name: "teams",
					entity: "superTeam"
				}, {
					type: "bool",
					name: "isAll"
				}, {
					type: "long",
					name: "timetag"
				}]
			},
			"21_10": {
				service: "superTeam",
				cmd: "updateInfoInSuperTeam"
			},
			"21_13": {
				service: "superTeam",
				cmd: "getSuperTeamMembers",
				response: [{
					type: "long",
					name: "timetag"
				}]
			},
			"21_11": {
				service: "superTeam",
				cmd: "getMySuperTeamMembers",
				response: [{
					type: "PropertyArray",
					name: "members",
					entity: "superTeamMember"
				}]
			},
			"21_14": {
				service: "superTeam",
				cmd: "getSuperTeamHistoryMsgs",
				response: [{
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"21_15": {
				service: "superTeam",
				cmd: "getSuperTeamMembersByJoinTime",
				response: [{
					type: "PropertyArray",
					name: "members",
					entity: "superTeamMember"
				}]
			},
			"21_16": {
				service: "superTeam",
				cmd: "sendSuperTeamCustomSysMsg",
				trivialErrorCodes: [7101]
			},
			"21_17": {
				service: "superTeam",
				cmd: "onDeleteSuperTeamMsg"
			},
			"21_18": {
				service: "superTeam",
				cmd: "onSuperTeamMsgDelete",
				response: [{
					type: "Property",
					name: "sysMsg"
				}]
			},
			"21_19": {
				service: "superTeam",
				cmd: "superTeamCustomSysMsg",
				response: [{
					type: "Property",
					name: "sysMsg"
				}]
			},
			"21_20": {
				service: "superTeam",
				cmd: "applySuperTeam",
				response: [{
					type: "Property",
					name: "team"
				}]
			},
			"21_21": {
				service: "superTeam",
				cmd: "passSuperTeamApply"
			},
			"21_22": {
				service: "superTeam",
				cmd: "rejectSuperTeamApply"
			},
			"21_23": {
				service: "superTeam",
				cmd: "acceptSuperTeamInvite",
				response: [{
					type: "Property",
					name: "team"
				}]
			},
			"21_24": {
				service: "superTeam",
				cmd: "rejectSuperTeamInvite"
			},
			"21_25": {
				service: "superTeam",
				cmd: "onMarkSuperTeamSessionAck"
			},
			"21_26": {
				service: "superTeam",
				cmd: "addSuperTeamManagers"
			},
			"21_27": {
				service: "superTeam",
				cmd: "removeSuperTeamManagers"
			},
			"21_28": {
				service: "superTeam",
				cmd: "updateSuperTeamMute"
			},
			"21_29": {
				service: "superTeam",
				cmd: "updateSuperTeamMembersMute",
				response: [{
					type: "long",
					name: "timetag"
				}]
			},
			"21_30": {
				service: "superTeam",
				cmd: "updateNickInSuperTeam"
			},
			"21_31": {
				service: "superTeam",
				cmd: "transferSuperTeam"
			},
			"21_32": {
				service: "superTeam",
				cmd: "onMarkSuperTeamSessionsAck"
			},
			"21_33": {
				service: "superTeam",
				cmd: "getSuperTeamMembersByAccounts",
				response: [{
					type: "PropertyArray",
					name: "members",
					entity: "superTeamMember"
				}]
			},
			"21_34": {
				service: "superTeam",
				cmd: "getMutedSuperTeamMembers",
				response: [{
					type: "PropertyArray",
					name: "members",
					entity: "superTeamMember"
				}]
			},
			"21_113": {
				service: "superTeam",
				cmd: "syncSuperTeamMembers",
				response: [{
					type: "Number",
					name: "teamId"
				}, {
					type: "PropertyArray",
					name: "members",
					entity: "superTeamMember"
				}, {
					type: "bool",
					name: "isAll"
				}, {
					type: "long",
					name: "timetag"
				}]
			},
			"21_111": {
				service: "superTeam",
				cmd: "syncMySuperTeamMembers",
				response: [{
					type: "PropertyArray",
					name: "teamMembers",
					entity: "superTeamMember"
				}, {
					type: "long",
					name: "timetag"
				}]
			},
			"21_109": {
				service: "superTeam",
				cmd: "syncSuperTeams",
				response: [{
					type: "PropertyArray",
					name: "teams",
					entity: "superTeam"
				}, {
					type: "bool",
					name: "isAll"
				}, {
					type: "long",
					name: "timetag"
				}]
			},
			"21_101": {
				service: "superTeam",
				cmd: "syncCreateSuperTeam",
				response: [{
					type: "Property",
					name: "team"
				}]
			},
			"21_102": {
				service: "superTeam",
				cmd: "syncSendSuperTeamMsg",
				response: [{
					type: "Property",
					name: "msg"
				}]
			},
			"21_110": {
				service: "superTeam",
				cmd: "syncUpdateSuperTeamMember",
				response: [{
					type: "Property",
					name: "teamMember",
					entity: "superTeamMember"
				}]
			},
			"21_117": {
				service: "superTeam",
				cmd: "syncDeleteSuperTeamMsg",
				response: [{
					type: "Property",
					name: "sysMsg"
				}]
			},
			"21_125": {
				service: "superTeam",
				cmd: "syncMarkSuperTeamSessionAck",
				response: [{
					type: "Long",
					name: "to"
				}, {
					type: "Long",
					name: "timetag"
				}]
			},
			"8_1": {
				service: "team",
				cmd: "createTeam",
				response: [{
					type: "Property",
					name: "team"
				}, {
					type: "StrArray",
					name: "abortedAccidList"
				}]
			},
			"8_2": {
				service: "team",
				cmd: "sendTeamMsg",
				response: [{
					type: "Property",
					name: "msg"
				}]
			},
			"8_3": {
				service: "team",
				cmd: "teamMsg",
				response: [{
					type: "Property",
					name: "msg"
				}]
			},
			"8_4": {
				service: "team",
				cmd: "teamMsgs",
				response: [{
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"8_5": {
				service: "team",
				cmd: "addTeamMembers",
				response: [{
					type: "long",
					name: "time"
				}, {
					type: "StrArray",
					name: "abortedAccidList"
				}]
			},
			"8_6": {
				service: "team",
				cmd: "removeTeamMembers"
			},
			"8_7": {
				service: "team",
				cmd: "updateTeam",
				response: [{
					type: "Number",
					name: "id"
				}, {
					type: "Number",
					name: "time"
				}]
			},
			"8_8": {
				service: "team",
				cmd: "leaveTeam"
			},
			"8_9": {
				service: "team",
				cmd: "getTeam",
				response: [{
					type: "Property",
					name: "team"
				}]
			},
			"8_10": {
				service: "team",
				cmd: "getTeams",
				response: [{
					type: "PropertyArray",
					name: "teams",
					entity: "team"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"8_11": {
				service: "team",
				cmd: "getTeamMembers",
				response: [{
					type: "Number",
					name: "teamId"
				}, {
					type: "PropertyArray",
					name: "members",
					entity: "teamMember"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"8_12": {
				service: "team",
				cmd: "dismissTeam"
			},
			"8_13": {
				service: "team",
				cmd: "applyTeam",
				response: [{
					type: "Property",
					name: "team"
				}]
			},
			"8_14": {
				service: "team",
				cmd: "passTeamApply"
			},
			"8_15": {
				service: "team",
				cmd: "rejectTeamApply"
			},
			"8_16": {
				service: "team",
				cmd: "addTeamManagers"
			},
			"8_17": {
				service: "team",
				cmd: "removeTeamManagers"
			},
			"8_18": {
				service: "team",
				cmd: "transferTeam"
			},
			"8_19": {
				service: "team",
				cmd: "updateInfoInTeam"
			},
			"8_20": {
				service: "team",
				cmd: "updateNickInTeam"
			},
			"8_21": {
				service: "team",
				cmd: "acceptTeamInvite",
				response: [{
					type: "Property",
					name: "team"
				}]
			},
			"8_22": {
				service: "team",
				cmd: "rejectTeamInvite"
			},
			"8_23": {
				service: "team",
				cmd: "getTeamHistoryMsgs",
				response: [{
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"8_24": {
				service: "team",
				cmd: "searchTeamHistoryMsgs",
				response: [{
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"8_25": {
				service: "team",
				cmd: "updateMuteStateInTeam"
			},
			"8_26": {
				service: "team",
				cmd: "getMyTeamMembers",
				response: [{
					type: "PropertyArray",
					name: "teamMembers",
					entity: "teamMember"
				}]
			},
			"8_27": {
				service: "team",
				cmd: "getMutedTeamMembers",
				response: [{
					type: "Number",
					name: "teamId"
				}, {
					type: "PropertyArray",
					name: "teamMembers",
					entity: "teamMember"
				}]
			},
			"8_28": {
				service: "team",
				cmd: "sendTeamMsgReceipt",
				response: [{
					type: "PropertyArray",
					name: "teamMsgReceipts",
					entity: "teamMsgReceipt"
				}]
			},
			"8_29": {
				service: "team",
				cmd: "getTeamMsgReads",
				response: [{
					type: "PropertyArray",
					name: "teamMsgReceipts",
					entity: "teamMsgReceipt"
				}]
			},
			"8_30": {
				service: "team",
				cmd: "getTeamMsgReadAccounts",
				response: [{
					type: "Property",
					name: "teamMsgReceipt"
				}, {
					type: "StrArray",
					name: "readAccounts"
				}, {
					type: "StrArray",
					name: "unreadAccounts"
				}]
			},
			"8_31": {
				service: "team",
				cmd: "notifyTeamMsgReads",
				response: [{
					type: "PropertyArray",
					name: "teamMsgReceipts",
					entity: "teamMsgReceipt"
				}]
			},
			"8_32": {
				service: "team",
				cmd: "muteTeamAll",
				response: []
			},
			"8_33": {
				service: "team",
				cmd: "getTeamMemberInvitorAccid",
				response: [{
					type: "object",
					name: "accountsMap"
				}]
			},
			"8_34": {
				service: "team",
				cmd: "getTeamsById",
				response: [{
					type: "PropertyArray",
					name: "teams",
					entity: "team"
				}, {
					type: "StrArray",
					name: "tids"
				}],
				trivialErrorCodes: [816]
			},
			"8_126": {
				service: "team",
				cmd: "syncMyTeamMembers",
				response: [{
					type: "PropertyArray",
					name: "teamMembers",
					entity: "teamMember"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"8_109": {
				service: "team",
				cmd: "syncTeams",
				response: [{
					type: "Number",
					name: "timetag"
				}, {
					type: "PropertyArray",
					name: "teams",
					entity: "team"
				}]
			},
			"8_111": {
				service: "team",
				cmd: "syncTeamMembers",
				response: [{
					type: "Number",
					name: "teamId"
				}, {
					type: "PropertyArray",
					name: "members",
					entity: "teamMember"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"8_101": {
				service: "team",
				cmd: "syncCreateTeam",
				response: [{
					type: "Property",
					name: "team"
				}]
			},
			"8_102": {
				service: "team",
				cmd: "syncSendTeamMsg",
				response: [{
					type: "Property",
					name: "msg"
				}]
			},
			"8_119": {
				service: "team",
				cmd: "syncUpdateTeamMember",
				response: [{
					type: "Property",
					name: "teamMember"
				}]
			},
			"12_1": {
				service: "friend",
				cmd: "friendRequest"
			},
			"12_101": {
				service: "friend",
				cmd: "syncFriendRequest",
				response: [{
					type: "String",
					name: "account"
				}, {
					type: "Number",
					name: "type"
				}, {
					type: "String",
					name: "ps"
				}]
			},
			"12_2": {
				service: "friend",
				cmd: "deleteFriend"
			},
			"12_102": {
				service: "friend",
				cmd: "syncDeleteFriend",
				response: [{
					type: "String",
					name: "account"
				}]
			},
			"12_3": {
				service: "friend",
				cmd: "updateFriend"
			},
			"12_103": {
				service: "friend",
				cmd: "syncUpdateFriend",
				response: [{
					type: "Property",
					name: "friend"
				}]
			},
			"12_4": {
				service: "friend",
				cmd: "getFriends",
				response: [{
					type: "PropertyArray",
					name: "friends",
					entity: "friend"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"12_5": {
				service: "friend",
				cmd: "syncFriends",
				response: [{
					type: "PropertyArray",
					name: "friends",
					entity: "friend"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"12_6": {
				service: "friend",
				cmd: "syncFriendUsers",
				response: [{
					type: "PropertyArray",
					name: "users",
					entity: "user"
				}, {
					type: "Number",
					name: "timetag"
				}]
			},
			"13_1": {
				service: "chatroom",
				cmd: "getChatroomAddress",
				response: [{
					type: "StrArray",
					name: "address"
				}]
			},
			"14_1": {
				service: "eventService",
				cmd: "publishEvent",
				response: [{
					type: "Property",
					name: "msgEvent"
				}]
			},
			"14_2": {
				service: "eventService",
				cmd: "pushEvent",
				response: [{
					type: "Property",
					name: "msgEvent"
				}]
			},
			"14_3": {
				service: "eventService",
				cmd: "subscribeEvent",
				response: [{
					type: "StrArray",
					name: "accounts"
				}]
			},
			"14_4": {
				service: "eventService",
				cmd: "unSubscribeEventsByAccounts",
				response: [{
					type: "StrArray",
					name: "accounts"
				}]
			},
			"14_5": {
				service: "eventService",
				cmd: "unSubscribeEventsByType"
			},
			"14_6": {
				service: "eventService",
				cmd: "querySubscribeEventsByAccounts",
				response: [{
					type: "PropertyArray",
					name: "msgEventSubscribes",
					entity: "msgEventSubscribe"
				}]
			},
			"14_7": {
				service: "eventService",
				cmd: "querySubscribeEventsByType",
				response: [{
					type: "PropertyArray",
					name: "msgEventSubscribes",
					entity: "msgEventSubscribe"
				}]
			},
			"14_9": {
				service: "eventService",
				cmd: "pushEvents",
				response: [{
					type: "PropertyArray",
					name: "msgEvents",
					entity: "msgEvent"
				}]
			},
			"22_1": {
				service: "proxyService",
				cmd: "httpProxy",
				response: [{
					type: "Property",
					name: "proxyTag"
				}]
			},
			"22_2": {
				service: "proxyService",
				cmd: "onProxyMsg",
				response: [{
					type: "Property",
					name: "proxyMsg",
					entity: "proxyMsgTag"
				}]
			},
			"24_1": {
				service: "qchat",
				cmd: "getQChatAddress",
				response: [{
					type: "StrArray",
					name: "address"
				}]
			},
			"101_1": {
				service: "filter",
				cmd: "sendFilterMsg",
				response: [{
					type: "Property",
					name: "msg"
				}]
			},
			"101_2": {
				service: "filter",
				cmd: "filterMsg",
				response: [{
					type: "Property",
					name: "msg"
				}]
			},
			"101_3": {
				service: "filter",
				cmd: "filterSysMsg",
				response: [{
					type: "Property",
					name: "sysMsg"
				}]
			},
			"101_7": {
				service: "filter",
				cmd: "sendFilterCustomSysMsg"
			}
		});
	e.exports = {
		idMap: i,
		cmdConfig: o,
		packetConfig: a
	}
}, function(e, t, n) {
	const s = n(11),
		r = n(96),
		i = n(46),
		o = n(39),
		a = n(40),
		c = n(0),
		m = n(101),
		u = n(43),
		l = n(10),
		d = n(102),
		p = n(103);
	e.exports = function(e) {
		c.merge(e, {
			platform: s,
			xhr: r,
			io: i,
			naturalSort: o,
			deepAccess: a,
			util: c,
			support: m,
			blob: u,
			ajax: l,
			LoggerPlugin: d,
			usePlugin: p
		})
	}
}, , , function(e, t, n) {
	var s = n(57).polyfill;
	try {
		s()
	} catch (e) {}
	try {
		s(GameGlobal)
	} catch (e) {}
	try {
		window = window || {}, s(window)
	} catch (e) {}
	try {
		localStorage = localStorage || n(34)
	} catch (e) {}
	try {
		XMLHttpRequest = XMLHttpRequest || n(35)
	} catch (e) {}
	try {
		FormData = FormData || n(22)
	} catch (e) {}
	try {
		WebSocket = WebSocket || n(37)
	} catch (e) {}
	try {
		navigator = navigator || n(38)
	} catch (e) {}
}, function(e, t, n) {
	(function(t) {
		var s = n(34),
			r = n(35),
			i = n(22),
			o = n(37),
			a = n(38);
		e.exports = {
			polyfill(e = t || window) {
				if ("object" != typeof e) throw new Error("polyfill target is not an Object");
				const n = {
					localStorage: s,
					XMLHttpRequest: r,
					FormData: i,
					WebSocket: o,
					Object: Object,
					navigator: a,
					location: Object.create(null)
				};
				for (let t in n) e[t] || (e[t] = n[t]);
				e.navigator.product = "WeixinApp"
			},
			localStorage: s,
			XMLHttpRequest: r,
			FormData: i,
			WebSocket: o
		}
	}).call(this, n(14))
}, function(e, t, n) {
	const s = n(1);
	"undefined" != typeof window && (window.console || s.isWeixinApp || (window.console = {
		log: function() {},
		info: function() {},
		warn: function() {},
		error: function() {}
	}))
}, function(e, t, n) {
	"use strict";
	var s = Object.prototype.hasOwnProperty,
		r = "~";

	function i() {}

	function o(e, t, n) {
		this.fn = e, this.context = t, this.once = n || !1
	}

	function a() {
		this._events = new i, this._eventsCount = 0
	}
	Object.create && (i.prototype = Object.create(null), (new i).__proto__ || (r = !1)), a.prototype
		.eventNames = function() {
			var e, t, n = [];
			if (0 === this._eventsCount) return n;
			for (t in e = this._events) s.call(e, t) && n.push(r ? t.slice(1) : t);
			return Object.getOwnPropertySymbols ? n.concat(Object.getOwnPropertySymbols(e)) : n
		}, a.prototype.listeners = function(e, t) {
			var n = r ? r + e : e,
				s = this._events[n];
			if (t) return !!s;
			if (!s) return [];
			if (s.fn) return [s.fn];
			for (var i = 0, o = s.length, a = new Array(o); i < o; i++) a[i] = s[i].fn;
			return a
		}, a.prototype.emit = function(e, t, n, s, i, o) {
			var a = r ? r + e : e;
			if (!this._events[a]) return !1;
			var c, m, u = this._events[a],
				l = arguments.length;
			if (u.fn) {
				switch (u.once && this.removeListener(e, u.fn, void 0, !0), l) {
					case 1:
						return u.fn.call(u.context), !0;
					case 2:
						return u.fn.call(u.context, t), !0;
					case 3:
						return u.fn.call(u.context, t, n), !0;
					case 4:
						return u.fn.call(u.context, t, n, s), !0;
					case 5:
						return u.fn.call(u.context, t, n, s, i), !0;
					case 6:
						return u.fn.call(u.context, t, n, s, i, o), !0
				}
				for (m = 1, c = new Array(l - 1); m < l; m++) c[m - 1] = arguments[m];
				u.fn.apply(u.context, c)
			} else {
				var d, p = u.length;
				for (m = 0; m < p; m++) switch (u[m].once && this.removeListener(e, u[m].fn, void 0, !0),
				l) {
					case 1:
						u[m].fn.call(u[m].context);
						break;
					case 2:
						u[m].fn.call(u[m].context, t);
						break;
					case 3:
						u[m].fn.call(u[m].context, t, n);
						break;
					case 4:
						u[m].fn.call(u[m].context, t, n, s);
						break;
					default:
						if (!c)
							for (d = 1, c = new Array(l - 1); d < l; d++) c[d - 1] = arguments[d];
						u[m].fn.apply(u[m].context, c)
				}
			}
			return !0
		}, a.prototype.on = function(e, t, n) {
			var s = new o(t, n || this),
				i = r ? r + e : e;
			return this._events[i] ? this._events[i].fn ? this._events[i] = [this._events[i], s] : this
				._events[i].push(s) : (this._events[i] = s, this._eventsCount++), this
		}, a.prototype.once = function(e, t, n) {
			var s = new o(t, n || this, !0),
				i = r ? r + e : e;
			return this._events[i] ? this._events[i].fn ? this._events[i] = [this._events[i], s] : this
				._events[i].push(s) : (this._events[i] = s, this._eventsCount++), this
		}, a.prototype.removeListener = function(e, t, n, s) {
			var o = r ? r + e : e;
			if (!this._events[o]) return this;
			if (!t) return 0 == --this._eventsCount ? this._events = new i : delete this._events[o], this;
			var a = this._events[o];
			if (a.fn) a.fn !== t || s && !a.once || n && a.context !== n || (0 == --this._eventsCount ? this
				._events = new i : delete this._events[o]);
			else {
				for (var c = 0, m = [], u = a.length; c < u; c++)(a[c].fn !== t || s && !a[c].once || n &&
					a[c].context !== n) && m.push(a[c]);
				m.length ? this._events[o] = 1 === m.length ? m[0] : m : 0 == --this._eventsCount ? this
					._events = new i : delete this._events[o]
			}
			return this
		}, a.prototype.removeAllListeners = function(e) {
			var t;
			return e ? (t = r ? r + e : e, this._events[t] && (0 == --this._eventsCount ? this._events =
				new i : delete this._events[t])) : (this._events = new i, this._eventsCount = 0), this
		}, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a
		.prototype.setMaxListeners = function() {
			return this
		}, a.prefixed = r, a.EventEmitter = a, e.exports = a
}, function(e, t, n) {
	var s = n(11),
		r = n(0),
		i = n(1),
		o = n(5),
		a = {};

	function c(e = {}) {
		r.merge(this, {
				options: e,
				debug: !1,
				api: "log",
				style: "color:blue;",
				log: r.emptyFunc,
				info: r.emptyFunc,
				warn: r.emptyFunc,
				error: r.emptyFunc
			}), this.prefix = e.prefix || "", this.localEnable = a.enable && e.dbLog && e.account, this
			.setDebug(e.debug), this.localEnable && (this._local = new a(e.account, e.expire), this._local
				.logError = this.error)
	}
	a = n(61);
	const m = c.prototype;
	var u = ["Chrome", "Safari", "Firefox"];
	m.setDebug = function(e = !1) {
		const t = this;
		if (t.debug = e, e.style && (t.style = e.style), r.exist(console))
			if (t.debug) {
				var n = console;
				t.debug = function() {
					var e = t.formatArgsAndSave(arguments, "debug"); - 1 !== u.indexOf(s.name) && r
						.isString(e[0]) && (e[0] = "%c" + e[0], e.splice(1, 0, t.style)), t._log(
							"debug", e)
				}, t.log = function() {
					var e = t.formatArgsAndSave(arguments, "log"); - 1 !== u.indexOf(s.name) && r
						.isString(e[0]) && (e[0] = "%c" + e[0], e.splice(1, 0, t.style)), t._log(
							"log", e)
				}, t.info = function() {
					var e = t.formatArgsAndSave(arguments, "info"); - 1 !== u.indexOf(s.name) && r
						.isString(e[0]) && (e[0] = "%c" + e[0], e.splice(1, 0, t.style)), t._log(
							"info", e)
				}, t.warn = function() {
					var e = t.formatArgsAndSave(arguments, "warn"); - 1 !== u.indexOf(s.name) && r
						.isString(e[0]) && (e[0] = "%c" + e[0], e.splice(1, 0, t.style)), t._log(
							"warn", e)
				}, t.error = function() {
					var e = t.formatArgsAndSave(arguments, "error"); - 1 !== u.indexOf(s.name) && r
						.isString(e[0]) && (e[0] = "%c" + e[0], e.splice(1, 0, t.style)), t._log(
							"error", e)
				}, t.options.logFunc ? t._log = () => {} : t._log = function(e, s) {
					if (n[e]) try {
						n[e].apply ? t.chrome(e, s) : t.ie(e, s)
					} catch (e) {}
				}, t.chrome = function(e, r) {
					-1 !== u.indexOf(s.name) ? n[e].apply(n, r) : t.ie(e, r)
				}, t.ie = function(e, t) {
					t.forEach((function(t) {
						n[e](JSON.stringify(t, null, 4))
					}))
				}
			} else if (i.isRN || this.localEnable || this.options.logFunc) {
			const e = !i.isRN && !this.localEnable;
			t.log = function() {
				t.formatArgsAndSave(arguments, "log", e)
			}, t.info = function() {
				t.formatArgsAndSave(arguments, "info", e)
			}, t.warn = function() {
				t.formatArgsAndSave(arguments, "warn", e)
			}, t.error = function() {
				t.formatArgsAndSave(arguments, "error", e)
			}
		}
	}, m.setLogDisabled = function() {
		this.localEnable = !1, this.log = function() {}, this.info = function() {}, this.warn =
			function() {}, this.error = function() {}
	}, m.formatArgsAndSave = function(e, t, n) {
		e = [].slice.call(e, 0);
		var s = new Date,
			i =
			`[NIM LOG ${l(s.getMonth()+1)+"-"+l(s.getDate())+" "+l(s.getHours())+":"+l(s.getMinutes())+":"+l(s.getSeconds())+":"+l(s.getMilliseconds(),3)} ${this.prefix.toUpperCase()}]  `,
			o = "";
		r.isString(e[0]) ? e[0] = i + e[0] : e.splice(0, 0, i), e.forEach((function(t, n) {
			r.isArray(t) || r.isObject(t) ? (e[n] = r.simpleClone(t), o += JSON.stringify(e[
				n]) + " ") : o += t + " "
		}));
		const a = this.options.logFunc;
		return a && r.isFunction(a[t]) && a[t].apply(a, e), !n && this.writeLocalLog(o, t, +s), e
	}, m.writeLocalLog = i.isRN ? function(e, t) {
		if (!(o.rnfs && o.rnfs.writeFile && o.rnfs.appendFile && o.rnfs.DocumentDirectoryPath)) return;
		if (!/error|warn|info/.test(t)) return;
		let n, s = o.rnfs,
			r = s.size / 2 - 256;

		function i(e) {
			return o.rnfs.DocumentDirectoryPath + "/nimlog_" + e + ".log"
		}
		e += "\r\n", s.nimPromise = s.nimPromise.then((function() {
			return n = i(s.nimIndex), s.exists(n)
		})).then(t => t ? s.appendFile(n, e) : s.writeFile(n, e)).then(() => s.stat(n)).then(e => {
			if (e.size > r) return s.nimIndex++, s.nimIndex > 1 && (s.nimIndex = s.nimIndex %
				2), s.unlink(i(s.nimIndex)).catch(e => Promise.resolve())
		}).catch(() => {})
	} : i.isBrowser ? function(e, t, n) {
		this._local && this._local.saveLog({
			log: e,
			level: t,
			time: n
		})
	} : () => {};
	var l = function(e, t) {
		t = t || 2;
		for (var n = "" + e; n.length < t;) n = "0" + n;
		return n
	};
	e.exports = c
}, function(e, t, n) {
	const s = n(62),
		r = n(63),
		i = n(0).getGlobal(),
		o = n(11).name,
		a = "function" == typeof s,
		c = i.indexedDB && !/^(IE)$/.test(o);

	function m(e, t) {
		this.logWorker = null, this.db = null, this.logQueue = [], this.callbackList = [], this.preTime =
			null, this.lastTime = +new Date, this.initLogLocal({
				name: e,
				expire: t
			})
	}
	const u = m.prototype;
	m.enable = !0, u.saveLog = function(e) {
			const t = this.logQueue.length;
			let n = this.logQueue[t - 1];
			e.time !== this.preTime ? ((this.logQueue.length > 50 || e.time - this.lastTime > 6e4 && this
					.logQueue.length > 0) && (this.doSaveLog(this.logQueue.slice(0)), this.lastTime = n
					.time, this.logQueue = []), this.logQueue.push(e), this.preTime = e.time) : n.log +=
				"\r\n" + e.log
		}, u.doSaveLog = () => {}, u.initLogLocal = () => {}, u.fetchLog = () => {}, u.deleteLogs = e => {},
		u.logError = () => {}, c ? a ? (u.doSaveLog = function(e) {
			this.logWorker.postMessage(e)
		}, u.initLogLocal = function(e) {
			this.logWorker = new s({}), this.logWorker.onmessage = e => {
				const t = e.data || {};
				switch (t.type) {
					case "fetchDone":
						this.fetchLogDone(t.code, t.msg);
						break;
					case "error":
						this.logError(t.msg)
				}
			}, this.logWorker.postMessage({
				type: "init",
				msg: e
			})
		}, u.fetchLog = function() {
			const e = this;
			return new Promise((function(t, n) {
				0 === e.callbackList.length && e.logWorker.postMessage({
					type: "fetch"
				}), e.callbackList.push(t), e.callbackList.push(n)
			}))
		}, u.fetchLogDone = function(e, t) {
			const n = 200 === e ? 0 : 1;
			for (let e = 0; e < this.callbackList.length / 2; e++) this.callbackList[2 * e + n](t);
			this.callbackList = []
		}, u.deleteLogs = function(e) {
			return this.logWorker.postMessage({
				type: "delete",
				msg: e
			}), Promise.resolve()
		}) : (u.doSaveLog = function(e) {
			this.db.putLog(e).catch(e => {
				this.logError({
					msg: "putLog error",
					error: e
				})
			})
		}, u.initLogLocal = function(e) {
			this.db = new r(e), this.db.init().catch(e => {
				this.logError({
					msg: "dbLog init error",
					error: e
				})
			})
		}, u.fetchLog = function() {
			return this.db.getAllLogs()
		}, u.deleteLogs = function(e) {
			return this.db.deleteLogs(e)
		}) : m.enable = !1, e.exports = m
}, function(e, t, n) {
	"use strict";
	n.r(t), n.d(t, "default", (function() {
		return i
	}));
	var s = n(48),
		r = n.n(s);

	function i() {
		return r()(
			'!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){const r=n(1);let o=null;function i(e){return e&&"string"!=typeof e?e.message?e.message:e.target&&e.target.error?e.target.error.message:"unknown error":e}self.onmessage=function(e){switch(e.data.type){case"init":n=e.data.msg,o=new r(n),o.init().catch(e=>{postMessage({type:"error",msg:{msg:"dbLog init error",error:i(e)}})});break;case"fetch":o.getAllLogs().then(e=>{postMessage({type:"fetchDone",code:200,msg:e})}).catch(e=>{postMessage({type:"fetchDone",code:500,msg:i(e)})});break;case"delete":o.deleteLogs(t).catch(e=>{postMessage({type:"deleteLogs",code:500,msg:i(e)})});break;default:!function(e){if(!o)return;o.putLog(e).then(e=>{postMessage(200)}).catch(e=>{postMessage({type:"error",msg:{msg:"putLog error",error:i(e)}})})}(e.data)}var t,n}},function(e,t,n){const r=n(2),o={log:{key:{keyPath:"time"},indexes:{level:{unique:!1},time:{unique:!0}}}};function i(e={}){this.server=null,this.expire=e.expire||72,this.name=e.name}const c=i.prototype;c.init=function(){if(!this.server)return r.open({server:"nim-log-"+this.name,version:1,schema:o}).then(e=>{this.server=e})},c.putLog=function(e){if(!this.server)return Promise.reject("no db server");const t=e.slice(-1)[0].time-36e5*this.expire;return this.deleteLogs(t).then(()=>this.server.add("log",e))},c.getAllLogs=function(){return this.server?this.server.query("log","time").all().execute().then(e=>{var t={},n=e.slice(-1)[0];return t.logs=e.map(e=>e.log).join("\\r\\n"),t.time=n&&n.time,t}):Promise.reject("no db server")},c.deleteLogs=function(e){return this.server?this.server.remove("log",null,"time",0,e):Promise.reject("no db server")},e.exports=i},function(e,t,n){(function(r){var o;!function(i,c){"use strict";var u,s=(i=void 0!==i?i:"undefined"!=typeof self?self:void 0!==r?r:{}).IDBKeyRange||i.webkitIDBKeyRange,a="readonly",f="readwrite",l=Object.prototype.hasOwnProperty,d=function(){if(!u&&!(u=i.indexedDB||i.webkitIndexedDB||i.mozIndexedDB||i.oIndexedDB||i.msIndexedDB||(null===i.indexedDB&&i.shimIndexedDB?i.shimIndexedDB:void 0)))throw"IndexedDB required";return u},m=function(e){return e},p=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},h=function(e){return"function"==typeof e},v=function(e){return"number"===p(e)},y=function(e){return"array"===p(e)},g=function(e){return void 0===e},b=function(e,t){var n=this,r=!1;this.name=t,this.getIndexedDB=function(){return e},this.add=function(t){if(r)throw"Database has been closed";for(var o=[],i=0,c=0;c<arguments.length-1;c++)if(Array.isArray(arguments[c+1]))for(var u=0;u<arguments[c+1].length;u++)o[i]=arguments[c+1][u],i++;else o[i]=arguments[c+1],i++;var s=e.transaction(t,f),a=s.objectStore(t);return new Promise((function(e,t){o.forEach((function(e){var t;if(e.item&&e.key){var n=e.key;e=e.item,t=a.add(e,n)}else t=a.add(e);t.onsuccess=function(t){var n=t.target,r=n.source.keyPath;null===r&&(r="__id__"),Object.defineProperty(e,r,{value:n.result,enumerable:!0})}})),s.oncomplete=function(){e(o,n)},s.onerror=function(e){e.preventDefault(),t(e)},s.onabort=function(e){t(e)}}))},this.updateAndDelete=function(t,n,o){if(r)throw"Database has been closed";var i=e.transaction(t,f),c=i.objectStore(t),u=c.keyPath;return new Promise((function(e,t){n.forEach((function(e){if(e.item&&e.key){var t=e.key;e=e.item,c.put(e,t)}else c.put(e)})),o.forEach((function(e){c.delete(e[u])})),i.oncomplete=function(){e([n,o])},i.onerror=function(e){t(e)}}))},this.update=function(t){if(r)throw"Database has been closed";for(var o,i=[],c=1;c<arguments.length;c++)o=arguments[c],Array.isArray(o)?i=i.concat(o):i.push(o);var u=e.transaction(t,f),s=u.objectStore(t);s.keyPath;return new Promise((function(e,t){i.forEach((function(e){var t;if(e.item&&e.key){var n=e.key;e=e.item,t=s.put(e,n)}else t=s.put(e);t.onsuccess=function(e){},t.onerror=function(e){}})),u.oncomplete=function(){e(i,n)},u.onerror=function(e){t(e)},u.onabort=function(e){t(e)}}))},this.remove=function(t,n,o,i,c,u,a){if(r)throw"Database has been closed";var l=e.transaction(t,f),d=l.objectStore(t);return new Promise((function(e,t){function r(e){return null==e}if(r(i)&&(i=-1/0),r(c)&&(c=1/0),null===n||Array.isArray(n)||(n=[n]),r(o))null!==n?n.forEach((function(e){d.delete(e)})):d.delete(range=s.bound(i,c,u,a));else{let e;e=null!==n?s.only(n[0]):s.bound(i,c,u,a),d.index(o).openCursor(e).onsuccess=function(e){let t=e.target.result;t&&(t.delete(),t.continue())}}l.oncomplete=function(){e()},l.onerror=function(e){t(e)},l.onabort=function(e){t(e)}}))},this.clear=function(t){if(r)throw"Database has been closed";var n=e.transaction(t,f);n.objectStore(t).clear();return new Promise((function(e,t){n.oncomplete=function(){e()},n.onerror=function(e){t(e)}}))},this.close=function(){r||(e.close(),r=!0,delete k[t])},this.get=function(t,n){if(r)throw"Database has been closed";var o=e.transaction(t),i=o.objectStore(t).get(n);return new Promise((function(e,t){i.onsuccess=function(t){e(t.target.result)},o.onerror=function(e){t(e)}}))},this.query=function(t,n){if(r)throw"Database has been closed";return new x(t,e,n)},this.count=function(t,n){if(r)throw"Database has been closed";e.transaction(t).objectStore(t)};for(var o=0,i=e.objectStoreNames.length;o<i;o++)!function(e){for(var t in n[e]={},n)l.call(n,t)&&"close"!==t&&(n[e][t]=function(t){return function(){var r=[e].concat([].slice.call(arguments,0));return n[t].apply(n,r)}}(t))}(e.objectStoreNames[o])},x=function(e,t,n){var r=this,o=!1,i=!1,c=function(r,c,u,l,d,m,p){return new Promise((function(v,y){var g=o||i?f:a,b=t.transaction(e,g),x=b.objectStore(e),w=n?x.index(n):x,k=r?s[r].apply(null,c):null,j=[],D=[k],P=0;d=d||null,m=m||[],"count"!==u&&D.push(l||"next");var S=!!o&&Object.keys(o);w[u].apply(w,D).onsuccess=function(e){var t=e.target.result;if("number"==typeof t)j=t;else if(t)if(null!==d&&d[0]>P)P=d[0],t.advance(d[0]);else if(null!==d&&P>=d[0]+d[1]);else{var n=!0,r="value"in t?t.value:t.key;m.forEach((function(e){e&&e.length&&(2===e.length?n=n&&r[e[0]]===e[1]:h(e[0])&&(n=n&&e[0].apply(void 0,[r])))})),n&&(P++,j.push(p(r)),i?t.delete():o&&(r=function(e){for(var t=0;t<S.length;t++){var n=S[t],r=o[n];r instanceof Function&&(r=r(e)),e[n]=r}return e}(r),t.update(r))),t.continue()}},b.oncomplete=function(){v(j)},b.onerror=function(e){y(e)},b.onabort=function(e){y(e)}}))},u=function(e,t){var n="next",r="openCursor",u=[],s=null,a=m,f=!1,l=function(){return c(e,t,r,f?n+"unique":n,s,u,a)},d=function(){return n=null,r="count",{execute:l}},p=function(){return 1==(s=y(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments,0,2)).length&&s.unshift(0),v(s[1])||(s=null),{execute:l,count:d,keys:b,filter:x,asc:w,desc:k,distinct:j,modify:D,limit:p,map:P,remove:S}},b=function(e){return(e=!!g(e)||!!e)&&(r="openKeyCursor"),{execute:l,keys:b,filter:x,asc:w,desc:k,distinct:j,modify:D,limit:p,map:P,remove:S}},x=function(){return u.push(Array.prototype.slice.call(arguments,0,2)),{execute:l,count:d,keys:b,filter:x,asc:w,desc:k,distinct:j,modify:D,limit:p,map:P,remove:S}},w=function(e){return e=!!g(e)||!!e,n=e?"next":"prev",{execute:l,count:d,keys:b,filter:x,asc:w,desc:k,distinct:j,modify:D,limit:p,map:P,remove:S}},k=function(e){return e=!!g(e)||!!e,n=e?"prev":"next",{execute:l,count:d,keys:b,filter:x,asc:w,desc:k,distinct:j,modify:D,limit:p,map:P,remove:S}},j=function(e){return e=!!g(e)||!!e,f=e,{execute:l,count:d,keys:b,filter:x,asc:w,desc:k,distinct:j,modify:D,limit:p,map:P,remove:S}},D=function(e){return o=e,{execute:l,count:d,keys:b,filter:x,asc:w,desc:k,distinct:j,modify:D,limit:p,map:P,remove:S}},P=function(e){return h(e)&&(a=e),{execute:l,count:d,keys:b,filter:x,asc:w,desc:k,distinct:j,modify:D,limit:p,map:P,remove:S}},S=function(e){return e=!!g(e)||!!e,i=e,{execute:l,count:d,keys:b,filter:x,asc:w,desc:k,distinct:j,modify:D,limit:p,map:P,remove:S}};return{execute:l,count:d,keys:b,filter:x,asc:w,desc:k,distinct:j,modify:D,limit:p,map:P,remove:S}};"only bound upperBound lowerBound".split(" ").forEach((function(e){r[e]=function(){return new u(e,arguments)}})),this.filter=function(){var e=new u(null,null);return e.filter.apply(e,arguments)},this.all=function(){return this.filter()}},w=function(e,t,n,r){var o=e.target.result,i=new b(o,t);return k[t]=o,Promise.resolve(i)},k={},j={version:"0.10.2",open:function(e){var t;return new Promise((function(n,r){if(k[e.server])w({target:{result:k[e.server]}},e.server,e.version,e.schema).then(n,r);else{try{t=d().open(e.server,e.version)}catch(e){r(e)}t.onsuccess=function(t){w(t,e.server,e.version,e.schema).then(n,r)},t.onupgradeneeded=function(t){!function(e,t,n){for(var r in"function"==typeof t&&(t=t()),t){var o,i=t[r];for(var c in o=!l.call(t,r)||n.objectStoreNames.contains(r)?e.currentTarget.transaction.objectStore(r):n.createObjectStore(r,i.key),i.indexes){var u=i.indexes[c];try{o.index(c)}catch(e){o.createIndex(c,u.key||c,Object.keys(u).length?u:{unique:!1})}}}}(t,e.schema,t.target.result)},t.onerror=function(e){r(e)}}}))},remove:function(e){return new Promise((function(t,n){if(!e)return t();var r,o;typeof e===b&&(e=e.name),"string"==typeof e&&(r=k[e]),r&&"function"==typeof r.close&&r.close();try{o=d().deleteDatabase(e)}catch(e){n(e)}o.onsuccess=function(n){delete k[e],t(e)},o.onerror=function(e){n(e)},o.onblocked=function(e){n(e)}}))}};void 0!==e.exports?e.exports=j:void 0===(o=function(){return j}.call(t,n,t,e))||(e.exports=o)}(void 0)}).call(this,n(3))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n}]);',
			"Worker", void 0, void 0)
	}
}, function(e, t, n) {
	const s = n(64),
		r = {
			log: {
				key: {
					keyPath: "time"
				},
				indexes: {
					level: {
						unique: !1
					},
					time: {
						unique: !0
					}
				}
			}
		};

	function i(e = {}) {
		this.server = null, this.expire = e.expire || 72, this.name = e.name
	}
	const o = i.prototype;
	o.init = function() {
		if (!this.server) return s.open({
			server: "nim-log-" + this.name,
			version: 1,
			schema: r
		}).then(e => {
			this.server = e
		})
	}, o.putLog = function(e) {
		if (!this.server) return Promise.reject("no db server");
		const t = e.slice(-1)[0].time - 36e5 * this.expire;
		return this.deleteLogs(t).then(() => this.server.add("log", e))
	}, o.getAllLogs = function() {
		return this.server ? this.server.query("log", "time").all().execute().then(e => {
			var t = {},
				n = e.slice(-1)[0];
			return t.logs = e.map(e => e.log).join("\r\n"), t.time = n && n.time, t
		}) : Promise.reject("no db server")
	}, o.deleteLogs = function(e) {
		return this.server ? this.server.remove("log", null, "time", 0, e) : Promise.reject(
			"no db server")
	}, e.exports = i
}, function(e, t, n) {
	(function(s) {
		var r;
		! function(i, o) {
			"use strict";
			var a, c = (i = void 0 !== i ? i : "undefined" != typeof self ? self : void 0 !== s ? s :
					{}).IDBKeyRange || i.webkitIDBKeyRange,
				m = "readonly",
				u = "readwrite",
				l = Object.prototype.hasOwnProperty,
				d = function() {
					if (!a && !(a = i.indexedDB || i.webkitIndexedDB || i.mozIndexedDB || i
							.oIndexedDB || i.msIndexedDB || (null === i.indexedDB && i.shimIndexedDB ? i
								.shimIndexedDB : void 0))) throw "IndexedDB required";
					return a
				},
				p = function(e) {
					return e
				},
				g = function(e) {
					return Object.prototype.toString.call(e).slice(8, -1).toLowerCase()
				},
				f = function(e) {
					return "function" == typeof e
				},
				h = function(e) {
					return "number" === g(e)
				},
				y = function(e) {
					return "array" === g(e)
				},
				v = function(e) {
					return void 0 === e
				},
				b = function(e, t) {
					var n = this,
						s = !1;
					this.name = t, this.getIndexedDB = function() {
						return e
					}, this.add = function(t) {
						if (s) throw "Database has been closed";
						for (var r = [], i = 0, o = 0; o < arguments.length - 1; o++)
							if (Array.isArray(arguments[o + 1]))
								for (var a = 0; a < arguments[o + 1].length; a++) r[i] = arguments[
									o + 1][a], i++;
							else r[i] = arguments[o + 1], i++;
						var c = e.transaction(t, u),
							m = c.objectStore(t);
						return new Promise((function(e, t) {
							r.forEach((function(e) {
								var t;
								if (e.item && e.key) {
									var n = e.key;
									e = e.item, t = m.add(e, n)
								} else t = m.add(e);
								t.onsuccess = function(t) {
									var n = t.target,
										s = n.source.keyPath;
									null === s && (s = "__id__"), Object
										.defineProperty(e, s, {
											value: n.result,
											enumerable: !0
										})
								}
							})), c.oncomplete = function() {
								e(r, n)
							}, c.onerror = function(e) {
								e.preventDefault(), t(e)
							}, c.onabort = function(e) {
								t(e)
							}
						}))
					}, this.updateAndDelete = function(t, n, r) {
						if (s) throw "Database has been closed";
						var i = e.transaction(t, u),
							o = i.objectStore(t),
							a = o.keyPath;
						return new Promise((function(e, t) {
							n.forEach((function(e) {
								if (e.item && e.key) {
									var t = e.key;
									e = e.item, o.put(e, t)
								} else o.put(e)
							})), r.forEach((function(e) {
								o.delete(e[a])
							})), i.oncomplete = function() {
								e([n, r])
							}, i.onerror = function(e) {
								t(e)
							}
						}))
					}, this.update = function(t) {
						if (s) throw "Database has been closed";
						for (var r, i = [], o = 1; o < arguments.length; o++) r = arguments[o],
							Array.isArray(r) ? i = i.concat(r) : i.push(r);
						var a = e.transaction(t, u),
							c = a.objectStore(t);
						c.keyPath;
						return new Promise((function(e, t) {
							i.forEach((function(e) {
								var t;
								if (e.item && e.key) {
									var n = e.key;
									e = e.item, t = c.put(e, n)
								} else t = c.put(e);
								t.onsuccess = function(e) {}, t.onerror =
									function(e) {}
							})), a.oncomplete = function() {
								e(i, n)
							}, a.onerror = function(e) {
								t(e)
							}, a.onabort = function(e) {
								t(e)
							}
						}))
					}, this.remove = function(t, n, r, i, o, a, m) {
						if (s) throw "Database has been closed";
						var l = e.transaction(t, u),
							d = l.objectStore(t);
						return new Promise((function(e, t) {
							function s(e) {
								return null == e
							}
							if (s(i) && (i = -1 / 0), s(o) && (o = 1 / 0), null === n ||
								Array.isArray(n) || (n = [n]), s(r)) null !== n ? n
								.forEach((function(e) {
									d.delete(e)
								})) : d.delete(range = c.bound(i, o, a, m));
							else {
								let e;
								e = null !== n ? c.only(n[0]) : c.bound(i, o, a, m), d
									.index(r).openCursor(e).onsuccess = function(e) {
										let t = e.target.result;
										t && (t.delete(), t.continue())
									}
							}
							l.oncomplete = function() {
								e()
							}, l.onerror = function(e) {
								t(e)
							}, l.onabort = function(e) {
								t(e)
							}
						}))
					}, this.clear = function(t) {
						if (s) throw "Database has been closed";
						var n = e.transaction(t, u);
						n.objectStore(t).clear();
						return new Promise((function(e, t) {
							n.oncomplete = function() {
								e()
							}, n.onerror = function(e) {
								t(e)
							}
						}))
					}, this.close = function() {
						s || (e.close(), s = !0, delete M[t])
					}, this.get = function(t, n) {
						if (s) throw "Database has been closed";
						var r = e.transaction(t),
							i = r.objectStore(t).get(n);
						return new Promise((function(e, t) {
							i.onsuccess = function(t) {
								e(t.target.result)
							}, r.onerror = function(e) {
								t(e)
							}
						}))
					}, this.query = function(t, n) {
						if (s) throw "Database has been closed";
						return new T(t, e, n)
					}, this.count = function(t, n) {
						if (s) throw "Database has been closed";
						e.transaction(t).objectStore(t)
					};
					for (var r = 0, i = e.objectStoreNames.length; r < i; r++) ! function(e) {
						for (var t in n[e] = {}, n) l.call(n, t) && "close" !== t && (n[e][t] =
							function(t) {
								return function() {
									var s = [e].concat([].slice.call(arguments, 0));
									return n[t].apply(n, s)
								}
							}(t))
					}(e.objectStoreNames[r])
				},
				T = function(e, t, n) {
					var s = this,
						r = !1,
						i = !1,
						o = function(s, o, a, l, d, p, g) {
							return new Promise((function(h, y) {
								var v = r || i ? u : m,
									b = t.transaction(e, v),
									T = b.objectStore(e),
									S = n ? T.index(n) : T,
									M = s ? c[s].apply(null, o) : null,
									k = [],
									C = [M],
									P = 0;
								d = d || null, p = p || [], "count" !== a && C.push(l ||
									"next");
								var I = !!r && Object.keys(r);
								S[a].apply(S, C).onsuccess = function(e) {
									var t = e.target.result;
									if ("number" == typeof t) k = t;
									else if (t)
										if (null !== d && d[0] > P) P = d[0], t.advance(
											d[0]);
										else if (null !== d && P >= d[0] + d[1]);
									else {
										var n = !0,
											s = "value" in t ? t.value : t.key;
										p.forEach((function(e) {
											e && e.length && (2 === e
												.length ? n = n && s[e[
													0]] === e[1] : f(e[
													0]) && (n = n && e[
													0].apply(void 0,
													[s])))
										})), n && (P++, k.push(g(s)), i ? t
										.delete() : r && (s = function(e) {
												for (var t = 0; t < I
													.length; t++) {
													var n = I[t],
														s = r[n];
													s instanceof Function && (
														s = s(e)), e[n] = s
												}
												return e
											}(s), t.update(s))), t.continue()
									}
								}, b.oncomplete = function() {
									h(k)
								}, b.onerror = function(e) {
									y(e)
								}, b.onabort = function(e) {
									y(e)
								}
							}))
						},
						a = function(e, t) {
							var n = "next",
								s = "openCursor",
								a = [],
								c = null,
								m = p,
								u = !1,
								l = function() {
									return o(e, t, s, u ? n + "unique" : n, c, a, m)
								},
								d = function() {
									return n = null, s = "count", {
										execute: l
									}
								},
								g = function() {
									return 1 == (c = y(arguments[0]) ? arguments[0] : Array.prototype
										.slice.call(arguments, 0, 2)).length && c.unshift(0), h(c[
										1]) || (c = null), {
										execute: l,
										count: d,
										keys: b,
										filter: T,
										asc: S,
										desc: M,
										distinct: k,
										modify: C,
										limit: g,
										map: P,
										remove: I
									}
								},
								b = function(e) {
									return (e = !!v(e) || !!e) && (s = "openKeyCursor"), {
										execute: l,
										keys: b,
										filter: T,
										asc: S,
										desc: M,
										distinct: k,
										modify: C,
										limit: g,
										map: P,
										remove: I
									}
								},
								T = function() {
									return a.push(Array.prototype.slice.call(arguments, 0, 2)), {
										execute: l,
										count: d,
										keys: b,
										filter: T,
										asc: S,
										desc: M,
										distinct: k,
										modify: C,
										limit: g,
										map: P,
										remove: I
									}
								},
								S = function(e) {
									return e = !!v(e) || !!e, n = e ? "next" : "prev", {
										execute: l,
										count: d,
										keys: b,
										filter: T,
										asc: S,
										desc: M,
										distinct: k,
										modify: C,
										limit: g,
										map: P,
										remove: I
									}
								},
								M = function(e) {
									return e = !!v(e) || !!e, n = e ? "prev" : "next", {
										execute: l,
										count: d,
										keys: b,
										filter: T,
										asc: S,
										desc: M,
										distinct: k,
										modify: C,
										limit: g,
										map: P,
										remove: I
									}
								},
								k = function(e) {
									return e = !!v(e) || !!e, u = e, {
										execute: l,
										count: d,
										keys: b,
										filter: T,
										asc: S,
										desc: M,
										distinct: k,
										modify: C,
										limit: g,
										map: P,
										remove: I
									}
								},
								C = function(e) {
									return r = e, {
										execute: l,
										count: d,
										keys: b,
										filter: T,
										asc: S,
										desc: M,
										distinct: k,
										modify: C,
										limit: g,
										map: P,
										remove: I
									}
								},
								P = function(e) {
									return f(e) && (m = e), {
										execute: l,
										count: d,
										keys: b,
										filter: T,
										asc: S,
										desc: M,
										distinct: k,
										modify: C,
										limit: g,
										map: P,
										remove: I
									}
								},
								I = function(e) {
									return e = !!v(e) || !!e, i = e, {
										execute: l,
										count: d,
										keys: b,
										filter: T,
										asc: S,
										desc: M,
										distinct: k,
										modify: C,
										limit: g,
										map: P,
										remove: I
									}
								};
							return {
								execute: l,
								count: d,
								keys: b,
								filter: T,
								asc: S,
								desc: M,
								distinct: k,
								modify: C,
								limit: g,
								map: P,
								remove: I
							}
						};
					"only bound upperBound lowerBound".split(" ").forEach((function(e) {
						s[e] = function() {
							return new a(e, arguments)
						}
					})), this.filter = function() {
						var e = new a(null, null);
						return e.filter.apply(e, arguments)
					}, this.all = function() {
						return this.filter()
					}
				},
				S = function(e, t, n, s) {
					var r = e.target.result,
						i = new b(r, t);
					return M[t] = r, Promise.resolve(i)
				},
				M = {},
				k = {
					version: "0.10.2",
					open: function(e) {
						var t;
						return new Promise((function(n, s) {
							if (M[e.server]) S({
								target: {
									result: M[e.server]
								}
							}, e.server, e.version, e.schema).then(n, s);
							else {
								try {
									t = d().open(e.server, e.version)
								} catch (e) {
									s(e)
								}
								t.onsuccess = function(t) {
									S(t, e.server, e.version, e.schema).then(n, s)
								}, t.onupgradeneeded = function(t) {
									! function(e, t, n) {
										for (var s in "function" == typeof t && (t =
												t()), t) {
											var r, i = t[s];
											for (var o in r = !l.call(t, s) || n
													.objectStoreNames.contains(s) ?
													e.currentTarget.transaction
													.objectStore(s) : n
													.createObjectStore(s, i.key), i
													.indexes) {
												var a = i.indexes[o];
												try {
													r.index(o)
												} catch (e) {
													r.createIndex(o, a.key || o,
														Object.keys(a).length ?
														a : {
															unique: !1
														})
												}
											}
										}
									}(t, e.schema, t.target.result)
								}, t.onerror = function(e) {
									s(e)
								}
							}
						}))
					},
					remove: function(e) {
						return new Promise((function(t, n) {
							if (!e) return t();
							var s, r;
							typeof e === b && (e = e.name), "string" == typeof e && (s =
								M[e]), s && "function" == typeof s.close && s
							.close();
							try {
								r = d().deleteDatabase(e)
							} catch (e) {
								n(e)
							}
							r.onsuccess = function(n) {
								delete M[e], t(e)
							}, r.onerror = function(e) {
								n(e)
							}, r.onblocked = function(e) {
								n(e)
							}
						}))
					}
				};
			void 0 !== e.exports ? e.exports = k : void 0 === (r = function() {
				return k
			}.call(t, n, t, e)) || (e.exports = r)
		}(void 0)
	}).call(this, n(14))
}, function(e, t, n) {
	var s = n(6),
		r = n(23);

	function i(e) {
		e.onuploading && this.on("uploading", e.onuploading), r.call(this, e)
	}
	var o = r.prototype,
		a = i.prototype = Object.create(o);
	a.doSend = function() {
		var e = this.options,
			t = e.headers,
			n = this.xhr = new XMLHttpRequest;
		if ("multipart/form-data" === t["Content-Type"]) {
			delete t["Content-Type"], n.upload.onprogress = this.onProgress.bind(this), n.upload
				.onload = this.onProgress.bind(this);
			var r = e.data;
			e.data = new window.FormData, r && s.getKeys(r, e.putFileAtEnd).forEach((function(t) {
				var n = r[t];
				n.tagName && "INPUT" === n.tagName.toUpperCase() ? "file" === n.type && []
					.forEach.call(n.files, (function(t) {
						e.data.append(s.dataset(n, "name") || n.name || t.name ||
							"file-" + s.uniqueID(), t)
					})) : e.data.append(t, n)
			}))
		} else t["x-nos-token"] && (n.upload.onprogress = this.onProgress.bind(this), n.upload.onload =
			this.onProgress.bind(this));
		n.onreadystatechange = this.onStateChange.bind(this), 0 !== e.timeout && (this.timer =
				setTimeout(this.onTimeout.bind(this), e.timeout)), n.open(e.method, e.url, !e.sync),
			Object.keys(t).forEach((function(e) {
				n.setRequestHeader(e, t[e])
			})), e.cookie && "withCredentials" in n && (n.withCredentials = !0), n.send(e.data), this
			.afterSend()
	}, a.onProgress = function(e) {
		e.lengthComputable && e.loaded <= e.total && this.emit("uploading", e)
	}, a.onStateChange = function() {
		var e, t = this.xhr;
		4 === t.readyState && (e = {
			status: t.status,
			result: t.responseText || ""
		}, this.onLoad(e))
	}, a.getResponseHeader = function(e) {
		var t = this.xhr;
		return t ? t.getResponseHeader(e) : ""
	}, a.destroy = function() {
		clearTimeout(this.timer);
		try {
			this.xhr.onreadystatechange = s.f, this.xhr.abort()
		} catch (e) {}
		o.destroy.call(this)
	}, e.exports = i
}, function(e, t, n) {
	var s;
	/*!
	 * EventEmitter v5.2.6 - git.io/ee
	 * Unlicense - http://unlicense.org/
	 * Oliver Caldwell - https://oli.me.uk/
	 * @preserve
	 */
	! function(t) {
		"use strict";

		function r() {}
		var i = r.prototype,
			o = t.EventEmitter;

		function a(e, t) {
			for (var n = e.length; n--;)
				if (e[n].listener === t) return n;
			return -1
		}

		function c(e) {
			return function() {
				return this[e].apply(this, arguments)
			}
		}
		i.getListeners = function(e) {
			var t, n, s = this._getEvents();
			if (e instanceof RegExp)
				for (n in t = {}, s) s.hasOwnProperty(n) && e.test(n) && (t[n] = s[n]);
			else t = s[e] || (s[e] = []);
			return t
		}, i.flattenListeners = function(e) {
			var t, n = [];
			for (t = 0; t < e.length; t += 1) n.push(e[t].listener);
			return n
		}, i.getListenersAsObject = function(e) {
			var t, n = this.getListeners(e);
			return n instanceof Array && ((t = {})[e] = n), t || n
		}, i.addListener = function(e, t) {
			if (! function e(t) {
					return "function" == typeof t || t instanceof RegExp || !(!t || "object" !=
						typeof t) && e(t.listener)
				}(t)) throw new TypeError("listener must be a function");
			var n, s = this.getListenersAsObject(e),
				r = "object" == typeof t;
			for (n in s) s.hasOwnProperty(n) && -1 === a(s[n], t) && s[n].push(r ? t : {
				listener: t,
				once: !1
			});
			return this
		}, i.on = c("addListener"), i.addOnceListener = function(e, t) {
			return this.addListener(e, {
				listener: t,
				once: !0
			})
		}, i.once = c("addOnceListener"), i.defineEvent = function(e) {
			return this.getListeners(e), this
		}, i.defineEvents = function(e) {
			for (var t = 0; t < e.length; t += 1) this.defineEvent(e[t]);
			return this
		}, i.removeListener = function(e, t) {
			var n, s, r = this.getListenersAsObject(e);
			for (s in r) r.hasOwnProperty(s) && -1 !== (n = a(r[s], t)) && r[s].splice(n, 1);
			return this
		}, i.off = c("removeListener"), i.addListeners = function(e, t) {
			return this.manipulateListeners(!1, e, t)
		}, i.removeListeners = function(e, t) {
			return this.manipulateListeners(!0, e, t)
		}, i.manipulateListeners = function(e, t, n) {
			var s, r, i = e ? this.removeListener : this.addListener,
				o = e ? this.removeListeners : this.addListeners;
			if ("object" != typeof t || t instanceof RegExp)
				for (s = n.length; s--;) i.call(this, t, n[s]);
			else
				for (s in t) t.hasOwnProperty(s) && (r = t[s]) && ("function" == typeof r ? i.call(this,
					s, r) : o.call(this, s, r));
			return this
		}, i.removeEvent = function(e) {
			var t, n = typeof e,
				s = this._getEvents();
			if ("string" === n) delete s[e];
			else if (e instanceof RegExp)
				for (t in s) s.hasOwnProperty(t) && e.test(t) && delete s[t];
			else delete this._events;
			return this
		}, i.removeAllListeners = c("removeEvent"), i.emitEvent = function(e, t) {
			var n, s, r, i, o = this.getListenersAsObject(e);
			for (i in o)
				if (o.hasOwnProperty(i))
					for (n = o[i].slice(0), r = 0; r < n.length; r++) !0 === (s = n[r]).once && this
						.removeListener(e, s.listener), s.listener.apply(this, t || []) === this
						._getOnceReturnValue() && this.removeListener(e, s.listener);
			return this
		}, i.trigger = c("emitEvent"), i.emit = function(e) {
			var t = Array.prototype.slice.call(arguments, 1);
			return this.emitEvent(e, t)
		}, i.setOnceReturnValue = function(e) {
			return this._onceReturnValue = e, this
		}, i._getOnceReturnValue = function() {
			return !this.hasOwnProperty("_onceReturnValue") || this._onceReturnValue
		}, i._getEvents = function() {
			return this._events || (this._events = {})
		}, r.noConflict = function() {
			return t.EventEmitter = o, r
		}, void 0 === (s = function() {
			return r
		}.call(t, n, t, e)) || (e.exports = s)
	}("undefined" != typeof window ? window : this || {})
}, function(e, t, n) {
	var s = n(6),
		r = n(23),
		i = n(41),
		o = "NEJ-UPLOAD-RESULT:",
		a = {};

	function c(e) {
		this.init(), r.call(this, e)
	}
	var m = r.prototype,
		u = c.prototype = Object.create(m);
	u.init = function() {
		var e = !1;

		function t(e) {
			var t = e.data;
			if (0 === t.indexOf(o)) {
				var n = (t = JSON.parse(t.replace(o, ""))).key,
					s = a[n];
				s && (delete a[n], t.result = decodeURIComponent(t.result || ""), s.onLoad(t.result))
			}
		}
		return function() {
			! function() {
				if (!e) {
					e = !0;
					const n = s.getGlobal();
					n.postMessage ? s.on(n, "message", t) : (i.addMsgListener(t), i.startTimer())
				}
			}()
		}
	}(), u.doSend = function() {
		var e = this,
			t = e.options,
			n = e.key = "zoro-ajax-upload-iframe-" + s.uniqueID();
		a[n] = e;
		var r = e.form = s.html2node('<form style="display:none;"></form>');
		"undefined" == typeof document || document.body.appendChild(r), r.target = n, r.method = "POST",
			r.enctype = "multipart/form-data", r.encoding = "multipart/form-data";
		var i = t.url,
			o = s.genUrlSep(i);
		r.action = i + o + "_proxy_=form";
		var c = t.data,
			m = [],
			u = [];

		function l() {
			m.forEach((function(e, t) {
				var n = u[t];
				n.parentNode && (e.name = n.name, s.isFunction(e.setAttribute) && e
					.setAttribute("form", n.getAttribute("form")), n.parentNode
					.replaceChild(e, n))
			}))
		}
		c && s.getKeys(c, t.putFileAtEnd).forEach((function(e) {
			var t = c[e];
			if (t.tagName && "INPUT" === t.tagName.toUpperCase()) {
				if ("file" === t.type) {
					var n = t,
						i = n.cloneNode(!0);
					n.parentNode.insertBefore(i, n);
					var o = s.dataset(n, "name");
					o && (n.name = o), r.appendChild(n), s.isFunction(n.setAttribute) && (n
							.setAttribute("form", ""), n.removeAttribute("form")), m.push(
						t), u.push(i)
				}
			} else {
				var a = s.html2node('<input type="hidden"/>');
				a.name = e, a.value = t, r.appendChild(a)
			}
		}));
		var d = e.iframe = s.createIframe({
			name: n,
			onload() {
				e.aborted ? l() : (s.on(d, "load", e.checkResult.bind(e)), r.submit(), l(), e
					.afterSend())
			}
		})
	}, u.checkResult = function() {
		var e, t;
		try {
			if ((t = ((e = this.iframe.contentWindow.document.body).innerText || e.textContent || "")
					.trim()).indexOf(o) >= 0 || e.innerHTML.indexOf(o) >= 0) return
		} catch (e) {
			return
		}
		this.onLoad(t)
	}, u.onLoad = function(e) {
		m.onLoad.call(this, {
			status: 200,
			result: e
		}), s.remove(this.form), s.remove(this.iframe), m.destroy.call(this)
	}, u.destroy = function() {
		s.remove(this.iframe), s.remove(this.form)
	}, u.abort = function() {
		this.aborted = !0, delete a[this.key], m.abort.call(this)
	}, e.exports = c
}, function(e, t, n) {
	var s = n(6),
		r = n(41),
		i = n(23),
		o = {};

	function a(e) {
		this.init(), i.call(this, e)
	}
	var c = i.prototype,
		m = a.prototype = Object.create(c);
	m.init = function() {
		var e = "NEJ-AJAX-DATA:",
			t = !1;

		function n(t) {
			var n = t.data;
			if (0 === n.indexOf(e)) {
				var s = (n = JSON.parse(n.replace(e, ""))).key,
					r = o[s];
				r && (delete o[s], n.result = decodeURIComponent(n.result || ""), r.onLoad(n))
			}
		}
		return function() {
			! function() {
				if (!t) {
					t = !0;
					const e = s.getGlobal();
					e.postMessage ? s.on(e, "message", n) : r.addMsgListener(n)
				}
			}()
		}
	}(), m.doSend = function() {
		var e = this.options,
			t = s.url2origin(e.url),
			n = e.proxyUrl || t + "/res/nej_proxy_frame.html",
			i = o[n];
		if (s.isArray(i)) i.push(this.doSend.bind(this, e));
		else {
			if (!i) return o[n] = [this.doSend.bind(this, e)], void s.createIframe({
				src: n,
				onload(e) {
					var t = o[n];
					o[n] = s.target(e).contentWindow, t.forEach((function(e) {
						try {
							e()
						} catch (e) {}
					}))
				}
			});
			if (!this.aborted) {
				var a = this.key = s.uniqueID();
				o[a] = this;
				var c = s.fetch({
					method: "GET",
					url: "",
					data: null,
					headers: {},
					timeout: 0
				}, e);
				c.key = a, r.postMessage(i, {
					data: c
				}), this.afterSend()
			}
		}
	}, m.abort = function() {
		this.aborted = !0, delete o[this.key], c.abort.call(this)
	}, e.exports = a
}, function(e, t, n) {
	var s, r, i = n(6),
		o = n(18),
		a = (s = /json/i, r = /post/i, function(e, t) {
			var n = (t = t || {}).data = t.data || {},
				a = t.headers = t.headers || {},
				c = i.checkWithDefault(a, "Accept", "application/json"),
				m = i.checkWithDefault(a, "Content-Type", "application/json");
			return s.test(c) && (t.type = "json"), r.test(t.method) && s.test(m) && (t.data = JSON
				.stringify(n)), o(e, t)
		});
	e.exports = a
}, function(e, t, n) {
	var s = n(18);
	e.exports = function(e, t) {
		return t.method = "POST", t.headers = t.headers || {}, t.headers["Content-Type"] =
			"multipart/form-data", t.timeout = 0, t.type = t.type || "json", s(e, t)
	}
}, function(e, t, n) {
	const s = n(1);
	var r = s.chunkSize,
		i = n(18),
		o = {
			mp4: "video/mp4",
			avi: "video/x-msvideo",
			wmv: "video/x-ms-wmv",
			mpeg: "video/mpeg",
			mov: "video/quicktime",
			aac: "audio/x-aac",
			wma: "audio/x-ms-wma",
			wav: "audio/x-wav",
			mp3: "audio/mp3"
		},
		a = function(e, t, n, c) {
			var m = {
				file: e.data[t],
				fileSize: e.data[t].size,
				fileUploadedSize: 0,
				percentage: 0
			};
			let u = e.url;

			function l(t) {
				var n = m.fileUploadedSize + t.loaded,
					s = Math.floor(1e4 * n / m.fileSize) / 100;
				if (parseInt(s) >= 100 && (s = 100, l = function() {}), m.percentage !== s) {
					m.percentage = s;
					var r = {
						docId: e.docId,
						total: m.fileSize,
						loaded: n,
						percentage: s,
						percentageText: s + "%"
					};
					e.fileInput && (r.fileInput = e.fileInput), e.blob && (r.blob = e.blob), e
						.uploadprogress(r)
				}
			}

			function d(t) {
				try {
					t = JSON.parse(t)
				} catch (e) {
					return void n.onError(e)
				}
				if (t.errMsg || t.errCode) n.onError(t);
				else if (t.offset < m.fileSize) delete h.onaftersend, m.fileUploadedSize = t.offset, n.sn =
					function(e, t, n, s) {
						var o = e.offset,
							a = e.offset + r;
						if ("undefined" == typeof FileReader) return t.data = s.file.slice(o, a), t.query
							.offset = e.offset, t.query.complete = a >= s.fileSize, t.query.context = e
							.context, t.onuploading = l, t.onload = d, t.onerror = p, i(u, t);
						var c = new FileReader;
						c.readAsArrayBuffer(s.file.slice(o, a)), c.onload = function(n) {
							t.data = n.target.result, t.query.offset = e.offset, t.query.complete = a >=
								s.fileSize, t.query.context = e.context, t.onuploading = l, t.onload =
								d, t.onerror = p, i(u, t)
						}
					}(t, h, 0, m);
				else {
					var o = s.genFileUrl(e.nosToken);
					"image" === e.type ? i(o + "?imageInfo", {
						onload: function(n) {
							try {
								n = JSON.parse(n), e.uploaddone(null, {
									docId: t.docId,
									w: n.Width,
									h: n.Height,
									orientation: n.Orientation || "",
									type: n.Type,
									size: n.Size || m.fileSize
								})
							} catch (e) {
								a(e)
							}
						},
						onerror: n => {
							if ("undefined" != typeof Image) {
								var s = new Image;
								s.src = o, s.onload = function() {
									e.uploaddone(null, {
										docId: t.docId,
										w: s.width,
										h: s.height,
										size: m.fileSize
									})
								}, s.onerror = function(e) {
									a(e)
								}
							} else a(n)
						}
					}) : "video" === e.type || "audio" === e.type ? i(o + "?vinfo", {
						onload: function(n) {
							try {
								(n = JSON.parse(n)).GetVideoInfo && n.GetVideoInfo.VideoInfo &&
									(n = n.GetVideoInfo.VideoInfo), e.uploaddone(null, {
										docId: t.docId,
										w: n.Width,
										h: n.Height,
										dur: n.Duration,
										orientation: n.Rotate,
										audioCodec: n.AudioCodec,
										videoCodec: n.VideoCodec,
										container: n.Container,
										size: n.Size || m.fileSize
									})
							} catch (e) {
								a(e)
							}
						},
						onerror: a
					}) : e.uploaddone(null, {
						docId: t.docId,
						size: m.fileSize
					})
				}

				function a(e) {
					n.onError(e)
				}
			}

			function p(s) {
				var r = s && s.code;

				function o() {
					try {
						if (s.result) var e = JSON.parse(s.result);
						else e = s;
						n.onError(e)
					} catch (e) {
						n.onError(e)
					}
				}
				0 === m.fileUploadedSize && e.nosLbsUrls && e.nosLbsUrls.length > 0 && "abort" !== r ? e
					.edgeList ? c < e.edgeList.length - 1 ? a(e, t, n, c + 1) : o() : function(e, t, n, s) {
						return new Promise((function(r, o) {
							function a() {
								i(n[e], {
									query: {
										version: "1.0",
										bucketname: t
									},
									method: "GET",
									onerror: c,
									onload: e => {
										try {
											(e = JSON.parse(e)) && e.upload && e
												.upload.length ? r(e.upload) : c()
										} catch (e) {
											c()
										}
									}
								})
							}

							function c() {
								s.onLbsUrlFail(n[e]), e < n.length - 1 ? (e++, a()) : r([])
							}
							a()
						}))
					}(0, e.nosToken.bucket, e.nosLbsUrls, n).then(s => {
						s.length > 0 ? (e.edgeList = s, e.updateNosEdgeList && e.updateNosEdgeList(s),
							a(e, t, n, c + 1)) : o()
					}) : o()
			}
			"number" != typeof c && (c = -1), e.edgeList && e.edgeList.length && (c = c > 0 ? c : 0, u = e
				.edgeList[c]), u += "/" + e.nosToken.bucket + "/" + e.nosToken.objectName;
			var g = e.data.file && e.data.file.type;
			if (!g || g.indexOf("/") < 0) {
				var f = (e.fileInputName || "").split(".").pop();
				"image" === e.type ? g = "image/" + ("jpg" === f ? "jpeg" : f) : "audio" !== e.type &&
					"video" !== e.type || (g = o[f])
			}
			var h = {
				query: {
					offset: 0,
					complete: r >= m.fileSize,
					version: "1.0"
				},
				headers: {
					"Content-Type": g || "application/octet-stream",
					"x-nos-token": e.nosToken.token
				},
				method: "POST",
				timeout: 0,
				onaftersend: function() {
					e.beginupload(n)
				},
				onuploading: l,
				onload: d,
				onerror: p
			};
			if ("undefined" != typeof FileReader) {
				var y = new FileReader;
				y.readAsArrayBuffer(m.file.slice(0, r)), y.onload = function(e) {
					h.data = e.target.result, i(u, h)
				}
			} else h.data = m.file.slice(0, r), i(u, h)
		};
	e.exports = a
}, function(e, t, n) {
	var s = n(7).fn;
	s.isConnected = function() {
		return !!this.protocol && this.protocol.isConnected()
	}, s.connect = function() {
		this.protocol.connect(!0)
	}, s.disconnect = function(e) {
		e = e || {}, this.protocol.disconnect(e.done)
	}
}, function(e, t, n) {
	const s = n(7).fn,
		r = n(0),
		i = n(74),
		o = n(4),
		a = n(1),
		c = n(42),
		m = n(75),
		u = n(9),
		l = n(43);
	s.sendText = function(e) {
		let {
			loc_x: t,
			loc_y: n,
			loc_z: s,
			...r
		} = e;
		return void 0 === t || void 0 === n || void 0 === s ? e = {
				...r
			} : ("number" != typeof e.loc_x && (e.loc_x = 0), "number" != typeof e.loc_y && (e.loc_y =
				0), "number" != typeof e.loc_z && (e.loc_z = 0)), this.processCallback(e), e.msg =
			new this.message.TextMessage(e), this.sendMsg(e)
	}, s.previewFile = function(e) {
		if (r.verifyOptions(e, "done", "msg::previewFile"), e.type || (e.type = "file"), r
			.verifyParamPresentJustOne(e, "dataURL blob fileInput filePath wxFilePath fileObject",
				"msg::previewFile"), r.exist(e.maxSize) && r.verifyParamType("maxSize", e.maxSize,
				"number", "api::previewFile"), r.exist(e.commonUpload) && r.verifyParamType(
				"commonUpload", e.commonUpload, "boolean", "api::previewFile"), e.nosSurvivalTime ? (r
				.verifyParamType("nosSurvivalTime", e.nosSurvivalTime, "number",
					"api::Base.getInstance"), r.verifyParamMin("nosSurvivalTime", e.nosSurvivalTime,
					86400, "api::Base.getInstance")) : e.nosSurvivalTime = this.nosSurvivalTime, e
			.filePath = e.filePath || e.wxFilePath, delete e.wxFilePath, e.dataURL) e.blob = l
			.fromDataURL(e.dataURL);
		else if (e.blob);
		else if (e.fileInput) {
			if (e.fileInput = r.verifyFileInput(e.fileInput, "msg::previewFile"), e.fileInput.files) {
				if (!e.fileInput.files.length) return void e.done(o.newNoFileError("请选择" + e.type +
					"文件", {
						callFunc: "msg::previewFile",
						fileInput: e.fileInput
					}), e);
				e.fileSize = e.fileInput.files[0].size
			}
			e.fileInputName = r.getFileName(e.fileInput)
		}
		this.processCallback(e);
		const t = JSON.stringify(c.genResponseBody(e.type) || {}).replace(/"/gi, '\\"');
		var n = null;
		const s = e.transcode ? "getNosTokenTrans" : "getNosToken";
		if (e.transcode) {
			r.verifyOptions(e, "fileInput", "msg::previewFile");
			var i = r.getFileInfo(e.fileInput);
			n = {
				transToken: {
					name: i.name,
					type: i.transcodeType,
					transType: "png" === e.transcode ? 11 : 10,
					size: i.size,
					body: t
				}
			}
		} else n = t;
		this[s]({
			responseBody: n,
			nosToken: {
				nosScene: e.nosScene || this.nosScene,
				nosSurvivalTime: e.nosSurvivalTime
			},
			callback: function(t, n) {
				t ? e.done(t) : (e.transcode ? (e.nosToken = n.nosToken, e.docId = n
					.docId) : e.nosToken = n, this._doPreviewFile(e))
			}.bind(this)
		})
	}, s._doPreviewFile = function(e) {
		var t = this;
		u.startUniErrCache("nos", {
			user_id: this.account,
			action: "upload"
		});
		var n, s = e.uploaddone,
			i = a.genUploadUrl(e.nosToken.bucket),
			l = a.chunkUploadUrl;
		t.logger.info("_doPreviewFile: start upload"), e.commonUpload || !l || a.isWeixinApp || a
			.isNodejs || a.isRN ? (e.commonUpload = !0, n = i) : (this.logger.info("use chunkUrl: ", l,
					a.nosLbsUrls), n = l, e.nosLbsUrls = a.nosLbsUrls, t.edgeList ? e.edgeList = t
				.edgeList : e.updateNosEdgeList = function(e) {
					t.edgeList = e
				});
		const d = this.assembleUploadParams(e.nosToken);

		function p(n, i, o) {
			if (t.logger.info("_doPreviewFile: upload done", n && n.message), e.uploaddone = s, n)
				return u.updateUniErrCache("nos", {
					operation_type: "transfer",
					error: n && n.message
				}), u.concludeUniErrCache("nos", 1), void e.done(n, e.callback.options);
			if (u.concludeUniErrCache("nos", 0), i = c.parseResponse(i, t.options.exifOrientation), o ||
				(i.url = a.genDownloadUrl(e.nosToken, d.Object, a.serverNosConfig.cdnDomain), e.nosToken
					.shortUrl && (i._url_safe = e.nosToken.shortUrl)), r.exist(e.fileInputName)) i
				.name = e.fileInputName;
			else if (e.blob) {
				const t = e.blob.name;
				if (i.name = t || "blob-" + i.md5, !t) {
					var m = e.blob.type;
					i.ext = m.slice(m.lastIndexOf("/") + 1)
				}
			} else e.filePath ? i.name = e.filePath : e.fileObject && (i.name = e.fileObject.fileName);
			if (!i.ext) {
				var l = i.name.lastIndexOf(".");
				i.ext = -1 === l ? "unknown" : i.name.slice(l + 1)
			}
			i.size = i.size || 0, e.done(null, r.copy(i))
		}
		if (a.isWeixinApp) r.verifyOptions(e, "filePath", "msg::_doPreviewFile"), t.fileQuickTransfer(e,
			p, (function() {
				let s = wx.uploadFile({
					url: n,
					filePath: e.filePath,
					name: "file",
					formData: d,
					fail(e) {
						p({
							code: "FAILED",
							msg: e
						}), t.logger.error("error:", "api::msg:upload file failed",
							e)
					},
					success(e) {
						if (200 === e.statusCode) try {
							p(null, JSON.parse(e.data))
						} catch (n) {
							t.logger.error("error:",
								"parse wx upload file res error", n), p({
								code: "PARSE_WX_UPLOAD_FILE_RES_ERROR",
								str: e.data,
								msg: e.errMsg
							})
						} else p({
							code: e.statusCode,
							msg: e.errMsg
						})
					}
				});
				"function" == typeof e.uploadprogress && s && (t.logger.info(
					"_doPreviewFile::mini uploadprogress"), s.onProgressUpdate((
					function(t) {
						e.uploadprogress({
							total: t.totalBytesExpectedToSend,
							loaded: t.totalBytesSent,
							percentage: t.progress,
							percentageText: t.progress + "%"
						})
					})))
			}));
		else if (a.isNodejs) {
			const s = {
				url: n,
				name: "file",
				formData: d,
				success(e) {
					if (200 === e.statusCode) try {
						p(null, JSON.parse(e.data))
					} catch (n) {
						t.protocol.logger.error("error:", "parse nodejs upload file res error",
							n), p({
							code: "PARSE_NODEJS_UPLOAD_FILE_RES_ERROR",
							str: e.data,
							msg: e.errMsg
						})
					} else p({
						code: e.statusCode,
						msg: e.errMsg
					})
				},
				fail(e) {
					p({
						code: "FAILED",
						msg: e
					}), t.protocol.logger.error("error:", "api::msg:upload file failed", e)
				}
			};
			if (e.filePath) s.filePath = e.filePath;
			else {
				if ("object" != typeof e.fileObject) throw new o(
					"Nodejs上传fileObject参数类型应如 {fileName:..,fileData:..} ");
				s.fileData = e.fileObject.fileData
			}
			t.fileQuickTransfer(e, p, (function() {
				m.uploadFile(s)
			}))
		} else if (a.isRN) {
			const s = {
				url: n,
				name: "file",
				formData: d,
				filePath: e.filePath,
				success(e) {
					if (e.ok && 200 === e.status) try {
						var n = e.headers.map && e.headers.map.etag;
						e.md5 = n ? "string" == typeof n ? n : n[0] : "UNKNOWN", p(null, e)
					} catch (n) {
						t.protocol.logger.error("error:",
							"parse React Native upload file res error", n), p({
							code: "PARSE_React_Native_UPLOAD_FILE_RES_ERROR",
							res: e
						})
					} else p({
						code: e.status,
						msg: e.statusText
					})
				},
				fail(e) {
					p({
						code: "FAILED",
						msg: e
					}), t.protocol.logger.error("error:", "api::msg:upload file failed", e)
				}
			};
			t.fileQuickTransfer(e, p, (function() {
				m.uploadFile(s)
			}))
		} else e.uploaddone = p, e.url = n, e.params = d, e.fileName = "file", t.fileQuickTransfer(e, p,
			(function() {
				return new m(e)
			}))
	}, s.fileQuickTransfer = function(e, t, n) {
		var s = this;
		e = e || {}, t instanceof Function || (t = function() {}), n instanceof Function || (n =
			function() {});
		let r = e.fastPass;
		if (r) try {
			r = JSON.parse(r), e.fastPass = r
		} catch (e) {
			s.protocol.logger.error("快传参数解析失败")
		}
		let i = e.fileInputName || e.name || e.blob && e.blob.name || "",
			o = e.fileSize || e.size || e.blob && e.blob.size || 0,
			c = r ? ((r.md5 || e.digest || "") + "").trim() : "",
			m = e.type || e.blob && e.blob.type;
		if (c && o >= a.threshold) {
			let e = !0;
			const u = {
				name: i,
				md5: c,
				ext: i.slice(i.lastIndexOf(".") + 1),
				type: m
			};
			switch (m) {
				case "image":
					r && r.w && r.h ? (u.w = r.w, u.h = r.h) : (e = !1, s.protocol.logger.error(
						"快传 image 文件缺少参数 w 或 h"));
					break;
				case "video":
					r && r.w && r.h && r.dur ? (u.w = r.w, u.h = r.h, u.dur = r.dur) : (e = !1, s
						.protocol.logger.error("快传 video 文件缺少参数 w 或 h 或 dur"));
					break;
				case "audio":
					r && r.dur ? u.dur = r.dur : (e = !1, s.protocol.logger.error(
						"快传 audio 文件缺少参数 dur"))
			}
			if (!e) return void n();
			let l = {
				fileQuickTransfer: {
					md5: c
				}
			};
			return o && (l.fileQuickTransfer.size = o), this.protocol.sendCmd("fileQuickTransfer", l, (
				e, r, i) => {
				!e && i && i.fileQuickTransfer && i.fileQuickTransfer.url || (s.protocol.logger
						.error("misc::fileQuickTransfer: not found", e, r), n()), i && i
					.fileQuickTransfer && i.fileQuickTransfer.threshold && (a.threshold = i
						.fileQuickTransfer.threshold || 0), i && i.fileQuickTransfer && i
					.fileQuickTransfer.url && (u.size = o || i.fileQuickTransfer.size, u.url = i
						.fileQuickTransfer.url, i.fileQuickTransfer._url_safe && (u._url_safe =
							i.fileQuickTransfer._url_safe), t(e, u, !0))
			})
		}
		n()
	}, s.sendFile = function(e) {
		if (e.type || (e.type = "file"), r.verifyParamPresentJustOne(e,
				"dataURL blob fileInput file filePath wxFilePath fileObject", "msg::sendFile"), r.exist(
				e.maxSize) && r.verifyParamType("maxSize", e.maxSize, "number", "api::previewFile"), r
			.exist(e.commonUpload) && r.verifyParamType("commonUpload", e.commonUpload, "boolean",
				"api::previewFile"), this.processCallback(e), e.filePath = e.filePath || e.wxFilePath,
			delete e.wxFilePath, e.dataURL) this._previewAndSendFile(e);
		else if (e.blob) this._previewAndSendFile(e);
		else if (e.fileInput) {
			if (e.fileInput = r.verifyFileInput(e.fileInput, "msg::sendFile"), e.fileInput.files && !e
				.fileInput.files.length) return void e.done(o.newNoFileError("请选择" + e.type + "文件", {
				callFunc: "msg::sendFile",
				fileInput: e.fileInput
			}), e.callback.options);
			this._previewAndSendFile(e)
		} else if (e.filePath || e.fileObject) this._previewAndSendFile(e);
		else if (e.file) {
			var t, n = e.file._url_safe;
			return n && (t = e.file.url, e.file.url = n, delete e.file._url_safe), e.msg = new this
				.message.FileMessage(e), this.sendMsg(e, t)
		}
	}, s._previewAndSendFile = function(e) {
		var t = this;
		r.verifyCallback(e, "uploaddone beforesend", "msg::_previewAndSendFile"), u.startUniErrCache(
			"nos", {
				user_id: this.account,
				action: "upload"
			});
		var n = e.done;
		e.done = function(s, i) {
			if (e.done = n, s) e.uploaddone(s, e.callback.options), e.done(s, e.callback.options);
			else {
				if (/chatroom/.test(e.scene)) return;
				var o;
				e.uploaddone(null, r.copy(i));
				var a = i._url_safe;
				a && (o = i.url, i.url = a, delete i._url_safe), e.file = i, e.msg = new t.message
					.FileMessage(e), e.beforesend(t.sendMsg(e, o))
			}
		}, t.previewFile(e)
	}, s.assembleUploadParams = function(e) {
		return e ? {
			Object: decodeURIComponent(e.objectName),
			"x-nos-token": e.token,
			"x-nos-entity-type": "json"
		} : null
	}, s.deleteFile = function(e) {
		r.verifyParamPresentJustOne(e, "docId", "msg::deleteFile"), this.removeFile({
			docId: e.docId,
			callback: function(t, n) {
				t ? e.error && e.error(t, n) : e.success && e.success(n)
			}
		})
	}, s.getFile = function(e) {
		r.verifyParamPresentJustOne(e, "docId", "msg::getFile"), this.fetchFile({
			docId: e.docId,
			callback: function(t, n) {
				t ? e.error && e.error(t, n) : e.success && e.success(n.info)
			}
		})
	}, s.getFileList = function(e) {
		const {
			fromDocId: t = "",
			limit: n = 10
		} = e, s = {
			limit: n
		};
		t && (s.fromDocId = t), this.fetchFileList({
			fileListParam: s,
			callback: function(t, s) {
				t ? (n > 30 && (t.message = t.message + "::文档条数超过限制:30"), e.error && e
					.error(t, s)) : e.success && e.success(s)
			}
		})
	}, s.sendGeo = function(e) {
		return this.processCallback(e), e.msg = new this.message.GeoMessage(e), this.sendMsg(e)
	}, s.sendTipMsg = function(e) {
		return this.processCallback(e), e.msg = new this.message.TipMessage(e), this.sendMsg(e)
	}, s.sendCustomMsg = function(e) {
		return this.processCallback(e), e.msg = new this.message.CustomMessage(e), this.sendMsg(e)
	}, s.sendRobotMsg = function(e) {
		this.logger.warn("this api will be abandon");
		return this.processCallback(e), e.msg = new this.message.RobotMessage(e), this.sendMsg(e)
	}, s.sendMsg = function(e, t) {
		var n, s = this.protocol,
			i = e.msg,
			o = {},
			a = !!e.isLocal;
		if (this.logger.warn("sendMsg::start: " + i.idClient), a && (e.time && (i.time = e.time), e
				.idClient && (i.idClient = e.idClient), e.localFrom && (n = e.localFrom + "")), e
			.resend && ("out" !== e.flow || "fail" !== e.status)) return r.onError("只能重发发送失败的消息");
		e.callback.options.idClient = i.idClient, this.beforeSendMsg(e, o);
		var c = e.rtnMsg = this.formatReturnMsg(i, n);
		return t && !this.options.keepNosSafeUrl && c.file && (c.file._url_safe = c.file.url, c.file
				.url = t, "audio" === c.type && (c.file.mp3Url = t + (~t.indexOf("?") ? "&" : "?") +
					"audioTrans&type=mp3")), c.hasOwnProperty("chatroomId") && !c.chatroomId ? r
			.onError("聊天室未连接") : (a && (c.status = "success", c.isLocal = !0), s.storeSendMsg && (o
					.promise = s.storeSendMsg(c)), e.cbaop = function(e) {
					if (e) return 7101 === e.code && (c.isInBlackList = !0), "server" !== e.from ? (c
							.status = "fail", s.updateSendMsgError && s.updateSendMsgError(c), c) :
						void 0
				}, a || (t && !this.options.keepNosSafeUrl && e.callback && (e.callback.originUrl = t),
					e.toAccids && e.toAccids.length && (i.toAccids = JSON.stringify(e.toAccids)), o
					.msg = i, this.sendCmd(e.cmd, o, e.callback)), this.afterSendMsg(e), a &&
				setTimeout((function() {
					c = r.simpleClone(c), e.done(null, c)
				}), 0), r.copy(c))
	}, s.beforeSendMsg = function() {}, s.afterSendMsg = function() {}, s.formatReturnMsg = function(e,
		t) {
		return e = r.copy(e), this.protocol.completeMsg(e), e.status = "sending", t && (e.from = t), e =
			this.message.reverse(e)
	}, s.resendMsg = function(e) {
		return r.verifyOptions(e, "msg", "msg::resendMsg"), this.trimMsgFlag(e), e.resend = !0, this
			._sendMsgByType(e)
	}, s.forwardMsg = function(e) {
		return r.verifyOptions(e, "msg", "msg::forwardMsg"), this.trimMsgFlag(e), this.beforeForwardMsg(
			e), e.forward = !0, e.msg.idClient = r.guid(), this._sendMsgByType(e)
	}, s.trimMsgFlag = function(e) {
		e && e.msg && (e.msg = r.copy(e.msg), delete e.msg.resend, delete e.msg.forward)
	}, s.beforeForwardMsg = function() {}, s._sendMsgByType = function(e) {
		switch (r.verifyOptions(e, "msg", "msg::_sendMsgByType"), r.verifyParamValid("msg.type", e.msg
			.type, this.message.validTypes, "msg::_sendMsgByType"), r.merge(e, e.msg), e.type) {
			case "text":
				return this.sendText(e);
			case "image":
			case "audio":
			case "video":
			case "file":
				return this.sendFile(e);
			case "geo":
				return this.sendGeo(e);
			case "custom":
				return this.sendCustomMsg(e);
			case "tip":
				return this.sendTipMsg(e);
			default:
				throw new o("不能发送类型为 " + e.type + " 的消息")
		}
	}, s.parseRobotTemplate = function(e) {
		if (this.logger.warn("this api will be abandon"), /<template[^>/]+\/>/.test(e)) return {
			raw: e,
			json: [{
				type: "text",
				name: "",
				text: ""
			}]
		};
		if (!/<template[^>/]+>/.test(e)) return {
			raw: e,
			json: [{
				type: "text",
				name: "",
				text: e
			}]
		};
		let t = new i({
			escapeMode: !1
		});
		e = e.replace(/<template [^>]+>/, "<template>");
		let n = t.xml2js(e);
		n = n.template.LinearLayout, Array.isArray(n) || (n = [n]);
		let s = [];
		return n = n.forEach(e => {
			e.image && (s = s.concat(o(e))), e.text && (s = s.concat(r(e))), e.link && (s = s
				.concat(function(e) {
					if (e.link) {
						let t = e.link;
						Array.isArray(t) || (t = [t]), t = t.map(e => (e.image && (e
								.image = o(e)), e.text && (e.text = r(e)),
							"url" === e._type ? (e.type = "url", e.style = e
								._style || "", e.target = e._target, delete e
								._target, delete e._style) : "block" === e
							._type && (e.type = "block", e.style = e._style ||
								"", e.params = e._params || "", e.target = e
								._target, delete e._params, delete e._target,
								delete e._style), delete e._type, e)), e.link = t
					}
					return e.link
				}(e)))
		}), {
			raw: e,
			json: s
		};

		function r(e) {
			return Array.isArray(e.text) || (e.text = [e.text]), e.text = e.text.map(e => ({
				type: "text",
				name: e._name,
				text: e.__text
			})), e.text
		}

		function o(e) {
			return Array.isArray(e.image) || (e.image = [e.image]), e.image = e.image.map(e => ({
				type: "image",
				name: e._name,
				url: e._url
			})), e.image
		}
	}
}, function(e, t, n) {
	var s, r, i;
	! function(n, o) {
		"use strict";
		r = [], void 0 === (i = "function" == typeof(s = function(e) {
			return function(t) {
				(t = t || {}).arrayAccessForm = t.arrayAccessForm || "none", t
					.emptyNodeForm = t.emptyNodeForm || "text", t.jsAttributeFilter = t
					.jsAttributeFilter, t.jsAttributeConverter = t.jsAttributeConverter, t
					.attributeConverters = t.attributeConverters || [], t
					.datetimeAccessFormPaths = t.datetimeAccessFormPaths || [], t
					.arrayAccessFormPaths = t.arrayAccessFormPaths || [], t.xmldomOptions =
					t.xmldomOptions || {}, void 0 === t.enableToStringFunc && (t
						.enableToStringFunc = !0), void 0 === t.skipEmptyTextNodesForObj &&
					(t.skipEmptyTextNodesForObj = !0), void 0 === t.stripWhitespaces && (t
						.stripWhitespaces = !0), void 0 === t.useDoubleQuotes && (t
						.useDoubleQuotes = !0), void 0 === t.ignoreRoot && (t.ignoreRoot = !
						1), void 0 === t.escapeMode && (t.escapeMode = !0), void 0 === t
					.attributePrefix && (t.attributePrefix = "_"), void 0 === t
					.selfClosingElements && (t.selfClosingElements = !0), void 0 === t
					.keepCData && (t.keepCData = !1), void 0 === t.jsDateUTC && (t
						.jsDateUTC = !1),
					function() {
						function e(e) {
							var t = String(e);
							return 1 === t.length && (t = "0" + t), t
						}
						"function" != typeof String.prototype.trim && (String.prototype
							.trim = function() {
								return this.replace(/^\s+|^\n+|(\s|\n)+$/g, "")
							}), "function" != typeof Date.prototype.toISOString && (Date
							.prototype.toISOString = function() {
								return this.getUTCFullYear() + "-" + e(this
									.getUTCMonth() + 1) + "-" + e(this.getUTCDate()) +
									"T" + e(this.getUTCHours()) + ":" + e(this
										.getUTCMinutes()) + ":" + e(this
									.getUTCSeconds()) + "." + String((this
										.getUTCMilliseconds() / 1e3).toFixed(3)).slice(
										2, 5) + "Z"
							})
					}();
				var n = 1,
					s = 3,
					r = 4,
					i = 8,
					o = 9;

				function a(e) {
					var t = e.localName;
					return null == t && (t = e.baseName), null != t && "" !== t || (t = e
						.nodeName), t
				}

				function c(e) {
					return "string" == typeof e ? e.replace(/&/g, "&amp;").replace(/</g,
						"&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(
						/'/g, "&#x27;") : e
				}

				function m(e, n, s) {
					switch (t.arrayAccessForm) {
						case "property":
							e[n] instanceof Array ? e[n + "_asArray"] = e[n] : e[n +
								"_asArray"] = [e[n]]
					}
					if (!(e[n] instanceof Array) && t.arrayAccessFormPaths.length > 0) {
						for (var r = !1, i = 0; i < t.arrayAccessFormPaths.length; i++) {
							var o = t.arrayAccessFormPaths[i];
							if ("string" == typeof o) {
								if (o === s) {
									r = !0;
									break
								}
							} else if (o instanceof RegExp) {
								if (o.test(s)) {
									r = !0;
									break
								}
							} else if ("function" == typeof o && o(n, s)) {
								r = !0;
								break
							}
						}
						r && (e[n] = [e[n]])
					}
				}

				function u(e) {
					var t = e.split(/[-T:+Z]/g),
						n = new Date(t[0], t[1] - 1, t[2]),
						s = t[5].split(".");
					if (n.setHours(t[3], t[4], s[0]), s.length > 1 && n.setMilliseconds(s[
							1]), t[6] && t[7]) {
						var r = 60 * t[6] + Number(t[7]);
						r = 0 + ("-" === (/\d\d-\d\d:\d\d$/.test(e) ? "-" : "+") ? -1 * r :
							r), n.setMinutes(n.getMinutes() - r - n.getTimezoneOffset())
					} else -1 !== e.indexOf("Z", e.length - 1) && (n = new Date(Date.UTC(n
						.getFullYear(), n.getMonth(), n.getDate(), n.getHours(),
						n.getMinutes(), n.getSeconds(), n.getMilliseconds())));
					return n
				}

				function l(e, n) {
					for (var s = {
							__cnt: 0
						}, r = e.childNodes, o = 0; o < r.length; o++) {
						var c = r.item(o),
							l = a(c);
						c.nodeType !== i && (s.__cnt++, null == s[l] ? (s[l] = d(c, n +
							"." + l), m(s, l, n + "." + l)) : (s[
							l] instanceof Array || (s[l] = [s[l]], m(s, l, n + "." +
								l)), s[l][s[l].length] = d(c, n + "." + l)))
					}
					for (var p = 0; p < e.attributes.length; p++) {
						var g = e.attributes.item(p);
						s.__cnt++;
						for (var f = g.value, h = 0; h < t.attributeConverters
							.length; h++) {
							var y = t.attributeConverters[h];
							y.test.call(null, g.name, g.value) && (f = y.convert.call(null,
								g.name, g.value))
						}
						s[t.attributePrefix + g.name] = f
					}
					var v = e.prefix;
					return v && (s.__cnt++, s.__prefix = v), s["#text"] && (s.__text = s[
								"#text"], s.__text instanceof Array && (s.__text = s.__text
								.join("\n")), t.escapeMode && (s.__text = s.__text.replace(
								/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g,
								'"').replace(/&#x27;/g, "'").replace(/&amp;/g, "&")), t
							.stripWhitespaces && (s.__text = s.__text.trim()), delete s[
								"#text"], "property" === t.arrayAccessForm && delete s[
								"#text_asArray"], s.__text = function(e, n, s) {
								if (t.datetimeAccessFormPaths.length > 0)
									for (var r = s.split(".#")[0], i = 0; i < t
										.datetimeAccessFormPaths.length; i++) {
										var o = t.datetimeAccessFormPaths[i];
										if ("string" == typeof o) {
											if (o === r) return u(e)
										} else if (o instanceof RegExp) {
											if (o.test(r)) return u(e)
										} else if ("function" == typeof o && o(r)) return u(
											e)
									}
								return e
							}(s.__text, 0, n + ".#text")), s.hasOwnProperty(
							"#cdata-section") && (s.__cdata = s["#cdata-section"], delete s[
								"#cdata-section"], "property" === t.arrayAccessForm &&
							delete s["#cdata-section_asArray"]), 1 === s.__cnt && s.__text ?
						s = s.__text : 0 === s.__cnt && "text" === t.emptyNodeForm ? s =
						"" : s.__cnt > 1 && void 0 !== s.__text && t
						.skipEmptyTextNodesForObj && (t.stripWhitespaces && "" === s
							.__text || "" === s.__text.trim()) && delete s.__text, delete s
						.__cnt, t.keepCData || s.hasOwnProperty("__text") || !s
						.hasOwnProperty("__cdata") || 1 !== Object.keys(s).length ? (t
							.enableToStringFunc && (s.__text || s.__cdata) && (s.toString =
								function() {
									return (this.__text ? this.__text : "") + (this
										.__cdata ? this.__cdata : "")
								}), s) : s.__cdata ? s.__cdata : ""
				}

				function d(e, i) {
					return e.nodeType === o ? function(e) {
							for (var s = {}, r = e.childNodes, i = 0; i < r.length; i++) {
								var o = r.item(i);
								if (o.nodeType === n) {
									var c = a(o);
									t.ignoreRoot ? s = d(o, c) : s[c] = d(o, c)
								}
							}
							return s
						}(e) : e.nodeType === n ? l(e, i) : e.nodeType === s || e
						.nodeType === r ? e.nodeValue : null
				}

				function p(e, n, s, r) {
					var i = "<" + (e && e.__prefix ? e.__prefix + ":" : "") + n;
					if (s)
						for (var o = 0; o < s.length; o++) {
							var a = s[o],
								m = e[a];
							t.escapeMode && (m = c(m)), i += " " + a.substr(t
									.attributePrefix.length) + "=", t.useDoubleQuotes ? i +=
								'"' + m + '"' : i += "'" + m + "'"
						}
					return i += r ? " />" : ">"
				}

				function g(e, t) {
					return "</" + (e && e.__prefix ? e.__prefix + ":" : "") + t + ">"
				}

				function f(e, n) {
					return "property" === t.arrayAccessForm && (s = n.toString(), r =
							"_asArray", -1 !== s.indexOf(r, s.length - r.length)) || 0 === n
						.toString().indexOf(t.attributePrefix) || 0 === n.toString()
						.indexOf("__") || e[n] instanceof Function;
					var s, r
				}

				function h(e) {
					var t = 0;
					if (e instanceof Object)
						for (var n in e) f(e, n) || t++;
					return t
				}

				function y(e) {
					var n = [];
					if (e instanceof Object)
						for (var s in e) - 1 === s.toString().indexOf("__") && 0 === s
							.toString().indexOf(t.attributePrefix) && n.push(s);
					return n
				}

				function v(e) {
					var n = "";
					return e instanceof Object ? n += function(e) {
						var n = "";
						return e.__cdata && (n += "<![CDATA[" + e.__cdata + "]]>"), (e
							.__text || "number" == typeof e.__text || "boolean" ==
							typeof e.__text) && (t.escapeMode ? n += c(e.__text) :
							n += e.__text), n
					}(e) : null !== e && (t.escapeMode ? n += c(e) : n += e), n
				}

				function b(e, n, s) {
					var r = "";
					if (t.jsAttributeFilter && t.jsAttributeFilter.call(null, n, e))
					return r;
					if (t.jsAttributeConverter && (e = t.jsAttributeConverter.call(null, n,
							e)), null != e && "" !== e || !t.selfClosingElements)
						if ("object" == typeof e)
							if ("[object Array]" === Object.prototype.toString.call(e)) r +=
								function(e, t, n) {
									var s = "";
									if (0 === e.length) s += p(e, t, n, !0);
									else
										for (var r = 0; r < e.length; r++) s += b(e[r], t,
											y(e[r]));
									return s
								}(e, n, s);
							else if (e instanceof Date) r += p(e, n, s, !1), r += t
						.jsDateUTC ? e.toUTCString() : e.toISOString(), r += g(e, n);
					else {
						h(e) > 0 || "number" == typeof e.__text || "boolean" == typeof e
							.__text || e.__text || e.__cdata ? (r += p(e, n, s, !1), r += T(
								e), r += g(e, n)) : t.selfClosingElements ? r += p(e, n, s,
								!0) : (r += p(e, n, s, !1), r += g(e, n))
					} else r += p(e, n, s, !1), r += v(e), r += g(e, n);
					else r += p(e, n, s, !0);
					return r
				}

				function T(e) {
					var t = "";
					if (h(e) > 0)
						for (var n in e)
							if (!f(e, n)) {
								var s = e[n];
								t += b(s, n, y(s))
							} return t += v(e)
				}

				function S(n) {
					if (void 0 === n) return null;
					if ("string" != typeof n) return null;
					var s = null,
						r = null;
					if (e) r = (s = new e(t.xmldomOptions)).parseFromString(n, "text/xml");
					else if (window && window.DOMParser) {
						s = new window.DOMParser;
						var i = null;
						if (!(window.ActiveXObject || "ActiveXObject" in window)) try {
							i = s.parseFromString("INVALID", "text/xml").childNodes[0]
								.namespaceURI
						} catch (e) {
							i = null
						}
						try {
							r = s.parseFromString(n, "text/xml"), null !== i && r
								.getElementsByTagNameNS(i, "parsererror").length > 0 && (r =
									null)
						} catch (e) {
							r = null
						}
					} else 0 === n.indexOf("<?") && (n = n.substr(n.indexOf("?>") + 2)), (
							r = new ActiveXObject("Microsoft.XMLDOM")).async = "false", r
						.loadXML(n);
					return r
				}
				this.asArray = function(e) {
					return null == e ? [] : e instanceof Array ? e : [e]
				}, this.toXmlDateTime = function(e) {
					return e instanceof Date ? e.toISOString() : "number" == typeof e ?
						new Date(e).toISOString() : null
				}, this.asDateTime = function(e) {
					return "string" == typeof e ? u(e) : e
				}, this.xml2dom = function(e) {
					return S(e)
				}, this.dom2js = function(e) {
					return d(e, null)
				}, this.js2dom = function(e) {
					return S(this.js2xml(e))
				}, this.xml2js = function(e) {
					var t = S(e);
					return null != t ? this.dom2js(t) : null
				}, this.js2xml = function(e) {
					return T(e)
				}, this.getVersion = function() {
					return "3.1.1"
				}
			}
		}) ? s.apply(t, r) : s) || (e.exports = i)
	}()
}, function(e, t, n) {
	const s = n(1);
	var r = n(0),
		i = n(4),
		o = n(10).upload,
		a = n(9),
		c = n(10).chunkUpload,
		m = n(10).abort,
		u = r.supportFormData;

	function l(e) {
		var t = this;
		t.options = r.copy(e), r.verifyOptions(e, "url fileName"), r.verifyParamPresentJustOne(e,
				"blob fileInput"), r.verifyCallback(e, "beginupload uploadprogress uploaddone"), e
			.fileInput && (e.fileInput = r.verifyFileInput(e.fileInput)), e.type && r.verifyFileType(e
			.type), e.timeout ? r.verifyParamType("timeout", e.timeout, "number") : e.timeout = 6e5, r
			.verifyFileUploadCallback(e), e.data = {}, e.params && r.merge(e.data, e.params);
		var n, m, l = e.fileName,
			d = e.fileInput;
		if (u) {
			if (d) {
				if (!(m = e.type ? r.filterFiles(d.files, e.type) : [].slice.call(d.files, 0)) || !m.length)
					return void e.uploaddone(i.newWrongFileTypeError("未读取到" + e.type +
						"类型的文件, 请确保文件选择节点的文件不为空, 并且请确保选择了" + e.type + "类型的文件"));
				e.data[l] = m[0], n = d.files[0].size
			} else if (e.blob) {
				if (e.data[l] = e.blob, "file" !== e.type && e.blob.type && -1 === e.blob.type.indexOf(e
						.type)) return void e.uploaddone(i.newWrongFileTypeError("未读取到" + e.type +
					"类型的文件, 请确保选择了" + e.type + "类型的文件"));
				n = e.blob.size
			}
			if (e.maxSize && n > e.maxSize) return void e.uploaddone(i.newFileTooLargeError(
				`上传文件大小超过${e.maxSize}限制`));
			if (!e.commonUpload) return n > s.chunkMaxSize ? void e.uploaddone(i.newFileTooLargeError(
				`直传文件大小超过${s.chunkMaxSize}限制`)) : (t.onLbsUrlFail = function(t) {
				a.startUniErrCache("nos", {
					user_id: e.account,
					action: "upload"
				}), a.updateUniErrCache("nos", {
					operation_type: "transfer",
					error: "lbs failed",
					target: t
				})
			}, void(t.sn = c(e, l, t, -1)));
			if (n > s.commonMaxSize) return void e.uploaddone(i.newFileTooLargeError(
				`普通上传文件大小超过${s.commonMaxSize}限制`))
		} else r.dataset(d, "name", l), e.data.input = d;
		var p = {
			data: e.data,
			onaftersend: function() {
				e.beginupload(t)
			},
			onuploading: function(t) {
				var n = Math.floor(1e4 * t.loaded / t.total) / 100,
					s = {
						docId: e.docId,
						total: t.total,
						loaded: t.loaded,
						percentage: n,
						percentageText: n + "%"
					};
				e.fileInput && (s.fileInput = e.fileInput), e.blob && (s.blob = e.blob), e
					.uploadprogress(s)
			},
			onload: function(n) {
				n.docId = e.docId, n.Error ? t.onError(n) : e.uploaddone(null, n)
			},
			onerror: function(n) {
				try {
					if (n.result) var s = JSON.parse(n.result);
					else s = n;
					t.onError(s)
				} catch (s) {
					e.uploaddone(new i(n.message, n.code), t.options)
				}
			}
		};
		u || (p.mode = "iframe"), p.putFileAtEnd = !0, t.sn = o(e.url, p)
	}
	l.prototype.onError = function(e) {
		var t, n, s, r = this.options;
		n = (t = (e = e || {}).Error || e || {}).Code || t.code || "unknown", s = t.Message || t
			.message || "未知错误", r.uploaddone(new i(n + "(" + s + ")", n))
	}, l.prototype.abort = function() {
		m(this.sn)
	}, e.exports = l
}, function(e, t, n) {
	var s = n(0),
		r = n(7).fn,
		i = n(44);
	const o = n(42),
		a = n(4);
	var c;
	r.transDoc = function(e) {
		s.verifyOptions(e, "fileInput done", "nos::transDoc");
		try {
			var t = e.fileInput.files[0],
				n = e.fileInputName = t.name,
				r = {
					ppt: 1,
					pptx: 2,
					pdf: 3,
					doc: 6,
					docx: 7
				},
				i = n.substring(n.lastIndexOf(".") + 1);
			if (["ppt", "pdf", "pptx", "doc", "docx"].indexOf(i) < 0) return void e.done(a
				.newNoFileError("请上传正确格式的文件【ppt, pptx, pdf, doc, docx】", {
					callFunc: "nos: transDoc",
					fileInput: e.fileInput
				}), e)
		} catch (t) {
			return void e.done(a.newNoFileError("请上传正确的文件节点", {
				callFunc: "msg::previewFile",
				fileInput: e.fileInput
			}), e)
		}
		var c = JSON.stringify(o.genResponseBody("file") || {}).replace(/"/gi, '\\"'),
			m = {
				transToken: {
					name: n,
					type: r[i],
					transType: "png" === e.transcode ? 11 : 10,
					size: t.size,
					body: c
				}
			};
		this.getNosTokenTrans({
			responseBody: m,
			nosToken: {
				nosScene: e.nosScene || this.nosScene,
				nosSurvivalTime: e.nosSurvivalTime
			},
			callback: function(t, n) {
				t ? e.done(t) : (e.nosToken = n.nosToken, e.docId = n.docId, this
					._doPreviewFile(e))
			}.bind(this)
		})
	}, r.getSimpleNosToken = function(e = {}) {
		return e.num = 1, s.verifyOptions(e), this.cbAndSendCmd("getSimpleNosToken", e)
	}, r.getNosToken = function({
		callback: e,
		nosToken: t,
		responseBody: n
	}) {
		var s = {
			tag: t.nosScene
		};
		t.nosSurvivalTime && t.nosSurvivalTime !== 1 / 0 && (s.expireSec = t.nosSurvivalTime), this
			.sendCmd("getNosToken", {
				responseBody: n,
				nosToken: s
			}, e)
	}, r.getNosTokenTrans = function(e) {
		this.sendCmd("getNosTokenTrans", e.responseBody, e.callback)
	}, r.getMixStoreToken = function(e) {
		this.sendCmd("getMixStoreToken", {
			mixTokenReq: {
				provider: e.curProvider,
				tokenCount: e.tokenCount || 1,
				tag: "im",
				returnBody: e.responseBody
			}
		}, e.callback)
	}, r.packFileDownloadName = function(e) {
		s.verifyOptions(e, "url name", !0, "", "nos::packFileDownloadName");
		var t = e.url;
		return t + s.genUrlSep(t) + "download=" + encodeURIComponent(e.name)
	}, r.audioToMp3 = function(e) {
		s.verifyOptions(e, "url", "nos::audioToMp3");
		var t = e.url;
		return t + s.genUrlSep(t) + "audioTrans&type=mp3"
	}, r.removeFile = function(e) {
		this.sendCmd("removeFile", e, e.callback)
	}, r.fetchFile = function(e) {
		this.sendCmd("fetchFile", e, e.callback)
	}, r.fetchFileList = function(e) {
		this.sendCmd("fetchFileList", e, e.callback)
	}, r.stripImageMeta = function(e) {
		return this.beforeProcessImage(e, "stripmeta")
	}, r.qualityImage = function(e) {
		return this.beforeProcessImage(e, "quality")
	}, r.interlaceImage = function(e) {
		return this.beforeProcessImage(e, "interlace")
	}, r.rotateImage = function(e) {
		return this.beforeProcessImage(e, "rotate")
	}, r.blurImage = function(e) {
		return this.beforeProcessImage(e, "blur")
	}, r.cropImage = function(e) {
		return this.beforeProcessImage(e, "crop")
	}, r.thumbnailImage = function(e) {
		return this.beforeProcessImage(e, "thumbnail")
	}, r.beforeProcessImage = function(e, t) {
		var n = s.copy(e);
		return n.type = t, e.ops = [n], this.processImage(e)
	}, r.processImage = function(e) {
		var t = this;
		s.verifyOptions(e, "url ops", !0, "", "nos::processImage"), s.verifyParamType("ops", e.ops,
			"array", "nos::processImage");
		var n = e.ops.map((function(e) {
			return s.verifyOptions(e, "type", !0, "", "nos::processImage"), s
				.verifyParamValid("type", e.type, i.validTypes, "nos::processImage"), t[
					"gen" + e.type.slice(0, 1).toUpperCase() + e.type.slice(1) + "Op"](e)
		}));
		t.processCallback(e), t.sendCmd("processImage", {
			url: e.url,
			imageOps: n
		}, e.callback)
	}, r.genStripmetaOp = function(e) {
		return new i({
			type: e.type,
			stripmeta: e.strip ? 1 : 0
		})
	}, r.genQualityOp = function(e) {
		s.verifyOptions(e, "quality", !0, "", "nos::genQualityOp"), s.verifyParamType("quality", e
			.quality, "number", "nos::genQualityOp"), s.verifyParamMin("quality", e.quality, 0,
			"nos::genQualityOp"), s.verifyParamMax("quality", e.quality, 100, "nos::genQualityOp");
		var t = Math.round(e.quality);
		return new i({
			type: e.type,
			qualityQuality: t
		})
	}, r.genInterlaceOp = function(e) {
		return new i({
			type: e.type
		})
	}, r.genRotateOp = function(e) {
		for (s.verifyOptions(e, "angle", !0, "", "nos::genRotateOp"), s.verifyParamType("angle", e
				.angle, "number", "nos::genRotateOp"); e.angle < 0;) e.angle = e.angle + 360;
		e.angle = e.angle % 360;
		var t = Math.round(e.angle);
		return new i({
			type: e.type,
			rotateAngle: t
		})
	}, r.genBlurOp = function(e) {
		s.verifyOptions(e, "radius sigma", "nos::genBlurOp"), s.verifyParamType("radius", e.radius,
				"number", "nos::genBlurOp"), s.verifyParamMin("radius", e.radius, 1, "nos::genBlurOp"),
			s.verifyParamMax("radius", e.radius, 50, "nos::genBlurOp"), s.verifyParamType("sigma", e
				.sigma, "number", "nos::genBlurOp"), s.verifyParamMin("sigma", e.sigma, 0,
				"nos::genBlurOp");
		var t = Math.round(e.radius),
			n = Math.round(e.sigma);
		return new i({
			type: e.type,
			blurRadius: t,
			blurSigma: n
		})
	}, r.genCropOp = function(e) {
		s.verifyOptions(e, "x y width height", "nos::genCropOp"), s.verifyParamType("x", e.x, "number",
				"nos::genCropOp"), s.verifyParamMin("x", e.x, 0, "nos::genCropOp"), s.verifyParamType(
				"y", e.y, "number", "nos::genCropOp"), s.verifyParamMin("y", e.y, 0, "nos::genCropOp"),
			s.verifyParamType("width", e.width, "number", "nos::genCropOp"), s.verifyParamMin("width", e
				.width, 0, "nos::genCropOp"), s.verifyParamType("height", e.height, "number",
				"nos::genCropOp"), s.verifyParamMin("height", e.height, 0, "nos::genCropOp");
		var t = Math.round(e.x),
			n = Math.round(e.y),
			r = Math.round(e.width),
			o = Math.round(e.height);
		return new i({
			type: e.type,
			cropX: t,
			cropY: n,
			cropWidth: r,
			cropHeight: o
		})
	}, r.genThumbnailOp = (c = {
		cover: "z",
		contain: "x",
		crop: "y"
	}, function(e) {
		s.verifyOptions(e, "mode", "nos::genThumbnailOp"), s.verifyParamValid("mode", e.mode, Object
				.keys(c), "nos::genThumbnailOp"), "contain" === e.mode ? s
			.verifyParamAtLeastPresentOne(e, "width height", "nos::genThumbnailOp") : s
			.verifyOptions(e, "width height", "nos::genThumbnailOp"), s.undef(e.width) && (e.width =
				0), s.undef(e.height) && (e.height = 0), s.verifyParamType("width", e.width,
				"number", "nos::genThumbnailOp"), s.verifyParamMin("width", e.width, 0,
				"nos::genThumbnailOp"), s.verifyParamType("height", e.height, "number",
				"nos::genThumbnailOp"), s.verifyParamMin("height", e.height, 0,
				"nos::genThumbnailOp");
		var t = Math.round(e.width),
			n = Math.round(e.height),
			r = new i({
				type: e.type,
				thumbnailMode: c[e.mode],
				thumbnailWidth: t,
				thumbnailHeight: n
			});
		if ("crop" === e.mode && s.notundef(e.axis)) {
			s.undef(e.axis.x) && (e.axis.x = 5), s.undef(e.axis.y) && (e.axis.y = 5), s
				.verifyParamMin("axis.x", e.axis.x, 0, "nos::genThumbnailOp"), s.verifyParamMax(
					"axis.x", e.axis.x, 10, "nos::genThumbnailOp"), s.verifyParamMin("axis.y", e
					.axis.y, 0, "nos::genThumbnailOp"), s.verifyParamMax("axis.y", e.axis.y, 10,
					"nos::genThumbnailOp");
			var o = Math.round(e.axis.x),
				a = Math.round(e.axis.y);
			r.thumbnailAxisX = o, r.thumbnailAxisY = a
		}
		return s.notundef(e.enlarge) && (s.verifyParamType("enlarge", e.enlarge, "boolean",
				"nos::genThumbnailOp"), e.enlarge && (r.thumbnailEnlarge = 1)), r
			.thumbnailToStatic = this.options.thumbnailToStatic ? 1 : 0, r
	}), r.getNosOriginUrl = function(e) {
		s.verifyOptions(e, "safeShortUrl", !0, "", "nos::getNosOriginUrl"), s.verifyParamType(
			"safeShortUrl", e.safeShortUrl, "string", "nos::getNosOriginUrl"), /^http(s)?:/.test(e
			.safeShortUrl) && ~e.safeShortUrl.indexOf("im_url=1") ? (this.processCallback(e), this
			.sendCmd("getNosOriginUrl", {
				nosFileUrlTag: {
					safeUrl: e.safeShortUrl
				}
			}, e.callback)) : e.done(new a("参数 “safeShortUrl” 内容非文件安全短链", {
			callFunc: "nos: getNosOriginUrl"
		}), e)
	}
}, function(e, t, n) {
	const {
		genUrlSep: s,
		url2object: r,
		object2url: i
	} = n(16);
	var o, a = n(0),
		c = n(7).fn;
	c.viewImageSync = function(e) {
		const t = this.options;
		a.verifyOptions(e, "url", "nos::viewImageSync");
		let n = e.url,
			{
				protocol: s,
				hostname: o,
				path: c,
				query: m
			} = r(n);
		if ("boolean" == typeof e.strip && (m.stripmeta = e.strip ? 1 : 0), "number" == typeof e
			.quality && (a.verifyParamMin("quality", e.quality, 0, "nos::viewImageSync"), a
				.verifyParamMax("quality", e.quality, 100, "nos::viewImageSync"), m.quality = Math
				.round(e.quality)), "boolean" == typeof e.interlace && (m.interlace = e.interlace ? 1 :
				0), "number" == typeof e.rotate && (m.rotate = Math.round(e.rotate)), "object" ==
			typeof e.thumbnail) {
			let t = e.thumbnail.mode || "crop",
				n = e.thumbnail.width,
				s = e.thumbnail.height;
			if (n >= 0 && s >= 0 && n < 4096 && s < 4096 && (n > 0 || s > 0)) {
				switch (t) {
					case "crop":
						t = "y";
						break;
					case "contain":
						t = "x";
						break;
					case "cover":
						t = "z";
						break;
					default:
						t = "x"
				}
				m.thumbnail = `${n}${t}${s}`
			}
		}
		if (t.downloadUrl) {
			let n = r(e.url),
				s = t.downloadUrl,
				o = n.path,
				c = o.indexOf("/");
			if (-1 !== c) {
				let e = o.substring(0, c),
					t = o.substring(c + 1);
				s = s.replace("{bucket}", e).replace("{object}", t)
			}
			let u = r(s);
			return i({
				protocol: u.protocol,
				hostname: u.hostname,
				path: u.path,
				query: a.merge(u.query, m)
			})
		}
		return i({
			protocol: s,
			hostname: o,
			path: c,
			query: m
		})
	}, c.viewImageStripMeta = function(e) {
		a.verifyOptions(e, "url strip", "nos::viewImageStripMeta"), a.verifyParamType("strip", e.strip,
			"boolean", "nos::viewImageStripMeta");
		var t = "stripmeta=" + (e.strip ? 1 : 0),
			n = s(e.url);
		return e.url + n + t
	}, c.viewImageQuality = function(e) {
		a.verifyOptions(e, "url quality", "nos::viewImageQuality"), a.verifyParamType("quality", e
			.quality, "number", "nos::viewImageQuality"), a.verifyParamMin("quality", e.quality, 0,
			"nos::viewImageQuality"), a.verifyParamMax("quality", e.quality, 100,
			"nos::viewImageQuality");
		var t = "quality=" + Math.round(e.quality),
			n = s(e.url);
		return e.url + n + t
	}, c.viewImageInterlace = function(e) {
		a.verifyOptions(e, "url", "nos::viewImageInterlace");
		var t = s(e.url);
		return e.url + t + "interlace=1"
	}, c.viewImageRotate = function(e) {
		for (a.verifyOptions(e, "url angle", "nos::viewImageRotate"), a.verifyParamType("angle", e
				.angle, "number", "nos::viewImageRotate"); e.angle < 0;) e.angle = e.angle + 360;
		e.angle = e.angle % 360;
		var t = "rotate=" + Math.round(e.angle),
			n = s(e.url);
		return e.url + n + t
	}, c.viewImageBlur = function(e) {
		a.verifyOptions(e, "url radius sigma", "nos::viewImageBlur"), a.verifyParamType("radius", e
				.radius, "number", "nos::viewImageBlur"), a.verifyParamMin("radius", e.radius, 1,
				"nos::viewImageBlur"), a.verifyParamMax("radius", e.radius, 50, "nos::viewImageBlur"), a
			.verifyParamType("sigma", e.sigma, "number", "nos::viewImageBlur"), a.verifyParamMin(
				"sigma", e.sigma, 0, "nos::viewImageBlur");
		var t = "blur=" + Math.round(e.radius) + "x" + Math.round(e.sigma),
			n = s(e.url);
		return e.url + n + t
	}, c.viewImageCrop = function(e) {
		a.verifyOptions(e, "url x y width height", "nos::viewImageCrop"), a.verifyParamType("x", e.x,
				"number", "nos::viewImageCrop"), a.verifyParamMin("x", e.x, 0, "nos::viewImageCrop"), a
			.verifyParamType("y", e.y, "number", "nos::viewImageCrop"), a.verifyParamMin("y", e.y, 0,
				"nos::viewImageCrop"), a.verifyParamType("width", e.width, "number",
				"nos::viewImageCrop"), a.verifyParamMin("width", e.width, 0, "nos::viewImageCrop"), a
			.verifyParamType("height", e.height, "number", "nos::viewImageCrop"), a.verifyParamMin(
				"height", e.height, 0, "nos::viewImageCrop");
		var t = "crop=" + Math.round(e.x) + "_" + Math.round(e.y) + "_" + Math.round(e.width) + "_" +
			Math.round(e.height),
			n = s(e.url);
		return e.url + n + t
	}, c.viewImageThumbnail = (o = {
		cover: "z",
		contain: "x",
		crop: "y"
	}, function(e) {
		a.verifyOptions(e, "url mode", "nos::viewImageThumbnail"), a.verifyParamValid("mode", e
				.mode, Object.keys(o), "nos::viewImageThumbnail"), "contain" === e.mode ? a
			.verifyParamAtLeastPresentOne(e, "width height", "nos::viewImageThumbnail") : a
			.verifyOptions(e, "width height", "nos::viewImageThumbnail"), a.undef(e.width) && (e
				.width = 0), a.undef(e.height) && (e.height = 0), a.verifyParamType("width", e
				.width, "number", "nos::viewImageThumbnail"), a.verifyParamMin("width", e.width, 0,
				"nos::viewImageThumbnail"), a.verifyParamType("height", e.height, "number",
				"nos::viewImageThumbnail"), a.verifyParamMin("height", e.height, 0,
				"nos::viewImageThumbnail");
		var t = Math.round(e.width),
			n = Math.round(e.height),
			r = "thumbnail=" + t + o[e.mode] + n;
		"crop" === e.mode && a.notundef(e.axis) && (a.undef(e.axis.x) && (e.axis.x = 5), a.undef(e
				.axis.y) && (e.axis.y = 5), a.verifyParamMin("axis.x", e.axis.x, 0,
				"nos::viewImageThumbnail"), a.verifyParamMax("axis.x", e.axis.x, 10,
				"nos::viewImageThumbnail"), a.verifyParamMin("axis.y", e.axis.y, 0,
				"nos::viewImageThumbnail"), a.verifyParamMax("axis.y", e.axis.y, 10,
				"nos::viewImageThumbnail"), r = r + "&axis=" + Math.round(e.axis.x) + "_" + Math
			.round(e.axis.y)), a.notundef(e.enlarge) && (a.verifyParamType("enlarge", e.enlarge,
			"boolean", "nos::viewImageThumbnail"), e.enlarge && (r += "&enlarge=1"));
		var i = s(e.url);
		return e.url + i + r
	})
}, function(e, t, n) {
	var s = n(0),
		r = n(7).fn,
		i = n(1);

	function o(e, t, n, s) {
		let r = !1,
			i = "";
		if (1 === n ? e.indexOf(t) >= 0 && (r = !0, i = t) : 2 === n && (i = new RegExp(t, "g"), i.test(
				e) && (r = !0)), r && "" !== i) switch (s) {
			case 1:
				return e.replace(i, "**");
			case 2:
				return {
					code: 2
				};
			case 3:
				return {
					code: 3
				}
		}
		return e
	}

	function a(e, t) {
		const n = t.match,
			s = t.operate;
		let r = e;
		for (let e = 0; e < t.keys.length; e++) {
			const i = t.keys[e],
				a = i.match || n,
				c = i.operate || s;
			try {
				if (r = o(r, i.key, a, c), "object" == typeof r) return r
			} catch (e) {
				this.logger.warn("misc::filterContent: js cannot parse this regexp ", e)
			}
		}
		return r
	}
	r.uploadSdkLogUrl = function(e) {
		return s.verifyOptions(e, "url", "misc::uploadSdkLogUrl"), this.cbAndSendCmd("uploadSdkLogUrl",
			e)
	}, r.getClientAntispamLexicon = function(e) {
		let t = (e = e || {}).done;
		t instanceof Function || (t = function() {}), e = {
			clientAntispam: {
				version: 0
			}
		};
		var n = this;
		if (i.hasLocalStorage && localStorage.getItem("antispamLexicon") && "{}" !== localStorage
			.getItem("antispamLexicon")) try {
			n.antispamLexicon = JSON.parse(localStorage.getItem("antispamLexicon"))
		} catch (e) {
			this.logger.error("JSON parse antispamLexicon error", e)
		}
		n.antispamLexicon && t.call(this, null, {
			clientAntispam: n.antispamLexicon
		}), this.protocol.sendCmd("getClientAntispam", e, (e, s, r) => {
			e ? (n.protocol.logger.error("misc::getClientAntispamLexicon:", e), t.call(this,
			e, {})) : (i.hasLocalStorage && localStorage.setItem("antispamLexicon", JSON
				.stringify(r.clientAntispam)), n.antispamLexicon || t.call(this, null,
				r), n.antispamLexicon = r.clientAntispam || {})
		})
	}, r.filterClientAntispam = function(e) {
		let {
			content: t,
			antispamLexicon: n
		} = e;
		if (!t) return {
			code: 404,
			errmsg: "待反垃圾文本content不存在"
		};
		n = n || this.antispamLexicon || {};
		let s = this.antispamLexicon && this.antispamLexicon.thesaurus;
		if (!s) return {
			code: 404,
			errmsg: "没有反垃圾词库或者词库格式不合法"
		};
		try {
			s = JSON.parse(s).thesaurus
		} catch (e) {
			return this.protocol.logger.error("misc::filterClientAntispam: parse thesaurus error"), {
				code: 500,
				errmsg: "反垃圾词库格式不合法"
			}
		}
		let r = t;
		for (let e = 0; e < s.length; e++)
			if (r = a.call(this, r, s[e]), "object" == typeof r) {
				if (2 === r.code) return {
					code: 200,
					type: 2,
					errmsg: "建议拒绝发送",
					content: t,
					result: ""
				};
				if (3 === r.code) return {
					code: 200,
					type: 3,
					errmsg: "建议服务器处理反垃圾，发消息带上字段clientAntiSpam",
					content: t,
					result: t
				}
			} return r === t ? {
			code: 200,
			type: 0,
			errmsg: "",
			content: t,
			result: r
		} : {
			code: 200,
			type: 1,
			errmsg: "已对特殊字符做了过滤",
			content: t,
			result: r
		}
	}, r.getServerTime = function(e) {
		this.processCallback(e), this.sendCmd("getServerTime", {}, e.callback)
	}, r.getNosAccessToken = function(e) {
		s.verifyOptions(e, "url", "misc::getNosAccessToken"), this.processCallback(e);
		let t = {
			url: e.url
		};
		e.userAgent && (t.userAgent = e.userAgentv), e.ext && (t.ext = e.ext), this.sendCmd(
			"getNosAccessToken", {
				nosAccessTokenTag: t
			}, (function(t, n, s) {
				var r = s && s.nosAccessTokenTag && s.nosAccessTokenTag.token,
					i = e.url,
					o = r ? {
						token: r,
						resUrl: i.indexOf("?") ? i + "&token=" + r : i + "?token=" + r
					} : {};
				e.done(t, o)
			}))
	}, r.deleteNosAccessToken = function(e) {
		s.verifyOptions(e, "token", "misc::deleteNosAccessToken"), this.processCallback(e), this
			.sendCmd("deleteNosAccessToken", {
				nosAccessTokenTag: {
					token: e.token
				}
			}, e.callback)
	}
}, function(e, t, n) {
	const s = n(7).fn,
		r = n(0),
		i = n(10),
		o = n(1);
	let a = n(11);
	a = a || {}, a.name = a.name || "", a.version = a.version || "", s.reportLogs = function(e = {}) {
		let t = this,
			n = t.options;
		const s = o.ntServerAddress;
		if (!s) return;
		let c = o.info;
		e = r.merge(e, {
			appkey: n.appKey,
			uid: n.account,
			os: "web",
			session: t.protocol.sdkSession || "",
			ver: c.sdkVersion,
			type: t.subType,
			platform: `${a.name.toLowerCase()}${a.version.replace(/(\.\d+)+$/,"")}`
		});
		let m = s + r.genUrlSep(s),
			u = [];
		for (let t in e) u.push(`${t}=${e[t]}`);
		m += u.join("&"), i(m, {
			proxyUrl: r.url2origin(m) + "/lbs/res/cors/nej_proxy_frame.html",
			timeout: o.xhrTimeout,
			onload() {},
			onerror(e) {
				t.logger.error("report::ajax report error", e)
			}
		})
	}
}, function(e, t, n) {
	const s = n(7).fn,
		r = n(0),
		i = n(24),
		o = n(45);
	s.signalingCreate = function(e = {}) {
		const {
			type: t,
			channelName: n,
			ext: s
		} = e;
		return r.verifyOptions(e, "type", "api::signalling"), this.sendCmdUsePromise(
		"signalingCreate", {
			avSignalTag: {
				type: t,
				channelName: n,
				ext: s
			}
		}).then(e => {
			const {
				avSignalTag: t
			} = e;
			return Promise.resolve(t)
		}).catch(e => Promise.reject(o.parseAvSignalError(e)))
	}, s.signalingDelay = function(e = {}) {
		return r.verifyOptions(e, "channelId", "api::signalling"), this.sendCmdUsePromise(
			"signalingDelay", {
				avSignalTag: e
			}).then(e => {
			const {
				avSignalTag: t
			} = e;
			return Promise.resolve(t)
		}).catch(e => Promise.reject(o.parseAvSignalError(e)))
	}, s.signalingClose = function(e = {}) {
		const {
			offlineEnabled: t
		} = e;
		return r.verifyOptions(e, "channelId", "api::signalling"), this.sendCmdUsePromise(
			"signalingClose", {
				avSignalTag: r.merge(e, {
					isSave: !0 === t ? 1 : 0
				})
			}).then(e => {
			const {
				avSignalTag: t
			} = e;
			return t.offlineEnabled = 1 === t.isSave, delete t.isSave, Promise.resolve(t)
		}).catch(e => Promise.reject(o.parseAvSignalError(e)))
	}, s.signalingJoin = function(e = {}) {
		const {
			offlineEnabled: t
		} = e;
		return r.verifyOptions(e, "channelId", "api::signalling"), this.sendCmdUsePromise(
			"signalingJoin", {
				avSignalTag: r.merge(e, {
					isSave: !0 === t ? 1 : 0
				})
			}).then(e => {
			const {
				avSignalTag: t
			} = e;
			let n = t.members;
			return "string" == typeof t.members && (n = JSON.parse(t.members).map(e => o
				.parseAvSignalMember(e))), t.members = n, Promise.resolve(t)
		}).catch(e => Promise.reject(o.parseAvSignalError(e)))
	}, s.signalingLeave = function(e = {}) {
		const {
			offlineEnabled: t
		} = e;
		return r.verifyOptions(e, "channelId", "api::signalling"), this.sendCmdUsePromise(
			"signalingLeave", {
				avSignalTag: r.merge(e, {
					isSave: !0 === t ? 1 : 0
				})
			}).then(e => {
			const {
				avSignalTag: t
			} = e;
			return t.offlineEnabled = 1 === t.isSave, delete t.isSave, Promise.resolve(t)
		}).catch(e => Promise.reject(o.parseAvSignalError(e)))
	}, s.signalingGetChannelInfo = function(e = {}) {
		const {
			channelName: t
		} = e;
		return r.verifyOptions(e, "channelName", "api::signalling"), this.sendCmdUsePromise(
			"signalingGetChannelInfo", {
				avSignalTag: {
					channelName: t
				}
			}).then(e => {
			const {
				avSignalTag: t
			} = e;
			let n = t.members;
			return "string" == typeof t.members && (n = JSON.parse(t.members).map(e => o
				.parseAvSignalMember(e))), t.members = n, Promise.resolve(t)
		}).catch(e => Promise.reject(o.parseAvSignalError(e)))
	}, s.signalingInvite = function(e = {}) {
		const {
			account: t,
			offlineEnabled: n,
			pushInfo: s = {}
		} = e;
		r.verifyOptions(e, "channelId requestId account", "api::signalling"), "object" == typeof s
			.pushPayload && (s.pushPayload = JSON.stringify(s.pushPayload));
		const i = r.merge(e, s, {
			to: t,
			isSave: !0 === n ? 1 : 0,
			needPush: !0 === s.needPush ? 1 : 0,
			needBadge: !1 === s.needBadge ? 0 : 1
		});
		return this.sendCmdUsePromise("signalingInvite", {
			avSignalTag: i
		}).then(e => {
			const {
				avSignalTag: t
			} = e;
			return t.offlineEnabled = 1 === t.isSave, t.needBadge = 1 === t.needBadge, t
				.needPush = 1 === t.needPush, delete t.isSave, Promise.resolve(t)
		}).catch(e => Promise.reject(o.parseAvSignalError(e)))
	}, s.signalingCancel = function(e) {
		const {
			account: t,
			offlineEnabled: n
		} = e;
		return r.verifyOptions(e, "channelId requestId account", "api::signalling"), this
			.sendCmdUsePromise("signalingCancel", {
				avSignalTag: r.merge(e, {
					to: t,
					isSave: !0 === n ? 1 : 0
				})
			}).then(e => {
				const {
					avSignalTag: t
				} = e;
				return t.offlineEnabled = 1 === t.isSave, delete t.isSave, Promise.resolve(t)
			}).catch(e => Promise.reject(o.parseAvSignalError(e)))
	}, s.signalingCreateAndJoin = function(e) {
		const {
			channelName: t,
			uid: n = 0,
			offlineEnabled: s = !0,
			attachExt: i = ""
		} = e;
		let o = "";
		return this.signalingCreate(e).catch(e => 10405 === e.code ? (this.logger.warn(
				"api::avSignal:signalingCall room already exists:", e), this
			.signalingGetChannelInfo({
				channelName: t
			})) : Promise.reject(e)).then(e => {
			o = e.channelId;
			const t = {
				channelId: o,
				offlineEnabled: s,
				attachExt: i
			};
			return n && r.merge(t, {
				uid: n
			}), this.signalingJoin(t)
		})
	}, s.signalingCall = function(e) {
		const {
			account: t,
			offlineEnabled: n,
			requestId: s
		} = e;
		r.verifyOptions(e, "type requestId account", "api::signalling");
		let i = "";
		return this.signalingCreateAndJoin(e).then(r => {
			i = r.channelId || i, this.logger.info("api::avSignal:signalingCall join:", i);
			const o = {
				channelId: i,
				account: t,
				requestId: s,
				offlineEnabled: n,
				attachExt: e.attachExt || "",
				pushInfo: e.pushInfo || {}
			};
			return this.signalingInvite(o)
		})
	}, s.signalingReject = function(e) {
		const {
			account: t,
			offlineEnabled: n
		} = e;
		return r.verifyOptions(e, "channelId requestId account", "api::signalling"), this
			.sendCmdUsePromise("signalingReject", {
				avSignalTag: r.merge(e, {
					to: t,
					isSave: !0 === n ? 1 : 0
				})
			}).then(e => {
				const {
					avSignalTag: t
				} = e;
				return t.offlineEnabled = 1 === t.isSave, delete t.isSave, Promise.resolve(t)
			}).catch(e => Promise.reject(o.parseAvSignalError(e)))
	}, s.signalingAccept = function(e) {
		const {
			account: t,
			offlineEnabled: n
		} = e;
		return r.verifyOptions(e, "channelId requestId account", "api::signalling"), this
			.sendCmdUsePromise("signalingAccept", {
				avSignalTag: r.merge(e, {
					to: t,
					isSave: !0 === n ? 1 : 0
				})
			}).then(e => {
				const {
					avSignalTag: t
				} = e;
				return t.offlineEnabled = 1 === t.isSave, delete t.isSave, Promise.resolve(t)
			}).catch(e => Promise.reject(o.parseAvSignalError(e))).then(t => {
				const {
					autoJoin: n
				} = e;
				if (n) {
					const t = {
						channelId: e.channelId,
						offlineEnabled: e.offlineEnabled,
						attachExt: e.joinAttachExt,
						uid: e.uid
					};
					return this.signalingJoin(t)
				}
				return t
			})
	}, s.signalingControl = function(e) {
		const {
			account: t
		} = e;
		return r.verifyOptions(e, "channelId", "api::signalling"), this.sendCmdUsePromise(
			"signalingControl", {
				avSignalTag: r.merge(e, t ? {
					to: t
				} : {})
			}).then(e => {
			const {
				avSignalTag: t
			} = e;
			return Promise.resolve(t)
		}).catch(e => Promise.reject(o.parseAvSignalError(e)))
	}, s.signalingSync = function() {
		return this.sendCmdUsePromise("sync", {
			sync: {
				avSignal: 0
			}
		}).then(e => {
			const {
				avSignalTag: t
			} = e;
			return Promise.resolve(t)
		}).catch(e => Promise.reject(o.parseAvSignalError(e)))
	}, s.signalingMarkMsgRead = function(e = {}) {
		r.verifyOptions(e, "msgid", "api::signalling");
		const {
			avSignal: t
		} = i.idMap;
		let n;
		return n = "string" == typeof e.msgid ? [e.msgid] : e.msgid, this.sendCmd("batchMarkRead", {
			sid: t.id,
			cid: t.signalingNotify,
			ids: n
		})
	}
}, function(e, t, n) {
	var s = n(12).fn,
		r = n(4),
		i = n(82),
		o = n(46),
		a = n(1),
		c = n(9),
		m = n(0);

	function u(e) {
		this.logger.log("offlineListener enter"), this.forceDisconnect();
		try {
			this.options.ondisconnect && this.options.ondisconnect({
				callFunc: "link::offlineListener",
				message: "offlineListener disconnect"
			})
		} catch (e) {
			throw self.logger.error("userOption:ondisconnect function error", e), e
		}
		this.onDisconnect("link::offlineListener")
	}

	function l() {
		this.logger.log("onlineListener start"), this && this.isConnected() && !this.connecting ? (this
			.stopHeartbeat(), this.sendCmd("heartbeat", null, e => {
				if (e) {
					this.logger.info("onlineListener heartbeat detect error", e);
					try {
						this.forceDisconnect(), this.onDisconnect("link::onHeartbeat")
					} catch (e) {
						this.logger.info("onlineListener heartbeat websocket.onclose", e)
					}
				} else this.logger.log("onlineListener heartbeat detect success")
			})) : this.logger.log("onlineListener disconnected or connecting", this && this
		.isConnected(), this.connecting)
	}
	s.initConnect = function() {
		this.socket = null, this.retryCount = 0, this.connecting = !1, this.shouldReconnect = !0, this
			.hasNotifyDisconnected = !1, this.doLogout = !1, c.initUniErrReport({
				appKey: this.options.appKey
			})
	}, s.resetConnect = function() {
		var e = this.options;
		m.notundef(e.needReconnect) ? (m.verifyParamType("needReconnect", e.needReconnect, "boolean",
				"link::resetConnect"), this.needReconnect = e.needReconnect) : this.needReconnect = !0,
			this.logger.info("link::resetConnect: needReconnect " + this.needReconnect), m.notundef(e
				.reconnectionAttempts) && m.verifyParamType("reconnectionAttempts", e
				.reconnectionAttempts, "number", "link::resetConnect"), m.notundef(e.noCacheLinkUrl) &&
			m.verifyParamType("noCacheLinkUrl", e.noCacheLinkUrl, "boolean", "link::resetConnect"), this
			.reconnectionAttempts = "number" == typeof e.reconnectionAttempts ? e.reconnectionAttempts :
			1 / 0, this.backoff = new i({
				min: a.reconnectionDelay,
				max: a.reconnectionDelayMax,
				jitter: a.reconnectionJitter
			})
	}, s.connect = function() {
		if (clearTimeout(this.connectTimer), this.isConnected()) this.logger.warn(
			"link::connect: already connected");
		else if (this.connecting) this.logger.warn("link::connect: already connecting");
		else if (c.restore(), this.autoconnect || c.startUniErrCache("login", {
				user_id: this.options.account,
				action: "manual_login"
			}), this.connecting = !0, this.hasNotifyDisconnected = !1, this.shouldReconnect = !0, this
			.socket && this.forceDisconnect(), this.logger.info(
				"link::connect: connect to new socket, autoconnect is " + this.autoconnect), "string" ==
			typeof this.options.socketUrl) this.connectToUrl(this.options.socketUrl);
		else {
			var e = this.getNextSocketUrl();
			e && !this.options.noCacheLinkUrl ? this.connectToUrl(e) : this.refreshSocketUrl()
		}
	}, s.getNextSocketUrl = function() {
		return this.socketUrls.shift()
	}, s.isConnected = function() {
		return !!this.socket && !!this.socket.socket && this.socket.socket.connected
	}, s.connectToUrl = function(e) {
		var t = this;
		if (e = e || "", t.url = e, t.logger.info("link::connectToUrl: " + e), "undefined" ==
			typeof window) {
			var n = m.getGlobal(),
				s = e.split(":");
			n && !n.location && s.length > 1 && (n.location = {
				protocol: s.shift(),
				port: s.pop(),
				hostname: s.join("")
			}), this.options.transports = ["websocket"]
		}
		var r = this.options.transports || ["websocket", "xhr-polling"];
		t.socket = o.connect(e, {
				transports: r,
				reconnect: !1,
				"force new connection": !0,
				"connect timeout": a.connectTimeout
			}), t.logger.info(`link::connectToUrl: socket url: ${e}, transports: ${JSON.stringify(r)}`),
			t.handshakeUrl = e, t.socket.on("connect", t.onConnect.bind(t)), t.socket.on(
				"handshake_failed", t.onHandshakeFailed.bind(t)), t.socket.on("connect_failed", t
				.onConnectFailed.bind(t)), t.socket.on("error", t.onError.bind(t)), t.socket.on(
				"message", t.onMessage.bind(t)), t.socket.on("disconnect", n => {
				t.logger.warn(`link::connectToUrl: socket url: ${e}, disconnected`), t.hasLogin = !
					1, t.doLogout ? t.logout() : t.onDisconnect("link::socketDisconnect")
			})
	}, s.disconnect = function(e) {
		var t = this;

		function n(n) {
			t.logger.info("link::disconnect: socket finally closed, ", n), clearTimeout(t
					.disconnectCallbackTimer), t.msgAckBufferManager && t.msgAckBufferManager.clear(),
				e(n)
		}
		if (e instanceof Function || (e = function() {}), clearTimeout(t.connectTimer), t
			.disconnectCallbackTimer = setTimeout(() => {
				e.call(t, "mark disconnected due to timeout")
			}, 1e4), t.mixStorePolicy = null, t.appGrayConfig = null, clearTimeout(t
				.mixStorePolicyClock), this.onlineListener && "undefined" != typeof window && m
			.isFunction(window.removeEventListener) && (window.removeEventListener("online", this
				.onlineListener), window.removeEventListener("offline", this.offlineListener)), t
			.socket && t.socket.socket && t.socket.socket.transport ? t.socket.socket.transport
			.onDisconnectDone = function(e) {
				n(e)
			} : n(null), t.isConnected()) t.logger.warn("link::disconnect: start disconnecting"), t
			.logout();
		else if (t.connecting) t.logger.warn("link::disconnect: abort connecting"), t
	.disconnectSocket();
		else {
			t.logger.warn("link::disconnect: start otherwise"), t.connecting = !1, t.shouldReconnect = !
				1, t.socket = null, t.autoconnect = !1;
			try {
				t.options.ondisconnect({
					callFunc: "link::disconnect",
					message: "manually disconnect status"
				})
			} catch (e) {
				throw t.logger.error("userOption:ondisconnect function error", e), e
			}
		}
	}, s.onConnect = function() {
		this.backoff && this.backoff.reset(), this.retryCount = 0, this.connecting = !1, this
			.shouldReconnect = !0, this.hasNotifyDisconnected = !1, this.logger.info(
				"link::onConnect: socket onconnected, start login"), c.updateUniSuccCache("login", {
				operation_type: "TCP",
				target: this.url
			}), this.login(), this.api.reportLogs({
				event: "ws_connected"
			})
	}, s.onHandshakeFailed = function() {
		this.logger.warn("link::onHandshakeFailed: shandshake failed"), this.api.reportLogs({
			event: "ws_handshake_failed"
		}), c.updateUniErrCache("login", {
			operation_type: "TCP",
			error: "ws_handshake_failed",
			target: this.handshakeUrl
		}), this.onDisconnect("link::onHandshakeFailed")
	}, s.onConnectFailed = function() {
		this.api.reportLogs({
			event: "ws_connect_failed"
		}), this.onDisconnect("link::onConnectFailed")
	}, s.onError = function() {
		var e = arguments[0];
		if (e) {
			if (c.updateUniErrCache("login", {
					operation_type: "TCP",
					error: "connect_timeout"
				}), this.api.reportLogs({
					event: "connect_timeout"
				}), void 0 !== e.x5ImgDecodeStatus) return;
			if ("[object Object]" === Object.prototype.toString.call(e) && Object.keys(e).length <= 0)
				return;
			this.onMiscError("连接错误", new r(e, "LINK_ERROR", {
				callFunc: "link::onError"
			}))
		}
		this.connecting = !1
	}, s.onDisconnect = function(e = null) {
		this.logger.warn("socket::onDisconnect: " + e), this.connecting = !1, this
			.markAllCallbackInvalid(r.newNetworkError({
				callFunc: e
			})), this.msgAckBufferManager && this.msgAckBufferManager.clear(), this.stopHeartbeat(),
			this.reconnect()
	}, s.willReconnect = function() {
		return this.shouldReconnect && this.needReconnect && this.retryCount < this.reconnectionAttempts
	}, s.reconnect = function() {
		this.willReconnect() ? (c.startUniErrCache("login", {
			user_id: this.options.account,
			action: "auto_login"
		}), this.socket && (this.logger.info("link::reconnect: try to force disconnect"), this
			.forceDisconnect()), this.doReconnect()) : this.notifyDisconnect()
	}, s.doReconnect = function() {
		var e = this;
		this.logger.warn("doReconnect"), e.socket = null, e.retryCount++, e.hasLogin = !1;
		var t, n = e.backoff.duration();
		e.logger.info(`link::reconnect: will retry after ${n}ms, retryCount ${e.retryCount}`);
		try {
			t = e.options.onwillreconnect({
				retryCount: e.retryCount,
				duration: n
			})
		} catch (t) {
			throw e.logger.error("userOption:onwillreconnect function error", t), t
		}
		clearTimeout(e.connectTimer), e.connectTimer = setTimeout(() => {
			1 == +e.options.authType && t instanceof Promise ? (e.logger.info(
				"link::reconnect: wait onwillreconnect promise"), t.finally(() => e
				.connect())) : e.connect()
		}, n)
	}, s.notifyConnectError = function(e) {
		var t = r.newConnectError({
			message: e,
			callFunc: "link::notifyConnectError"
		});
		this.logger.error("link::notifyConnectError:", t), this.options.onerror(t)
	}, s.notifyDisconnect = function(e) {
		if (this.hasNotifyDisconnected) this.logger.warn("notifyDisconnect:: already notified");
		else {
			this.hasNotifyDisconnected = !0, this.disconnectSocket(), this.forceDisconnect(), (e = e ||
					new r).retryCount = this.retryCount, e.willReconnect = this.willReconnect(), this
				.backoff && this.backoff.reset(), this.retryCount = 0, this.autoconnect = !1, this
				.logger.info("link::notifyDisconnect: ondisconnected", e);
			try {
				this.options.ondisconnect(e)
			} catch (e) {
				throw this.logger.error("userOption:ondisconnect function error", e), e
			}
			c.concludeUniErrCache("login", 1), this.onWbNotifyHangup instanceof Function && this
				.onWbNotifyHangup({
					content: {
						account: this.account,
						channelId: null,
						timetag: +Date()
					}
				})
		}
	}, s.disconnectSocket = function() {
		if (this.isConnected() || this.connecting) {
			this.connecting = !1, this.shouldReconnect = !1;
			try {
				this.socket.disconnect()
			} catch (e) {
				this.socket && "function" == typeof this.socket.removeAllListeners && this.socket
					.removeAllListeners(), this.logger.info(
						"link::disconnectSocket: disconnect failed, error ", e)
			}
		}
	}, s.initOnlineListener = function(e) {
		this.needReconnect && this.options && this.options.quickReconnect ? "undefined" !=
			typeof window && m.isFunction(window.addEventListener) ? this.onlineListener || (this
				.onlineListener = l.bind(this), this.offlineListener = u.bind(this), this.logger.info(
					"initOnlineListener success"), window.addEventListener("online", this
					.onlineListener), window.addEventListener("offline", this.offlineListener)) : this
			.logger.warn("initOnlineListener no window.addEventListener") : this.logger.warn(
				"initOnlineListener no quickReconnect")
	}, s.forceDisconnect = function() {
		let e = this.socket || {};
		this.socket = null;
		try {
			"function" == typeof e.removeAllListeners && e.removeAllListeners(), "function" == typeof e
				.disconnect && e.disconnect()
		} catch (e) {
			this.logger.error("forceDisconnect:: oldSocket error", e || e.message)
		}
		this.hasLogin = !1
	}
}, function(e, t) {
	function n(e) {
		e = e || {}, this.ms = e.min || 100, this.max = e.max || 1e4, this.factor = e.factor || 2, this
			.jitter = e.jitter > 0 && e.jitter <= 1 ? e.jitter : 0, this.attempts = 0
	}
	e.exports = n, n.prototype.duration = function() {
		var e = this.ms * Math.pow(this.factor, this.attempts++);
		if (this.jitter) {
			var t = Math.random(),
				n = Math.floor(t * this.jitter * e);
			e = 0 == (1 & Math.floor(10 * t)) ? e - n : e + n
		}
		return 0 | Math.min(e, this.max)
	}, n.prototype.reset = function() {
		this.attempts = 0
	}, n.prototype.setMin = function(e) {
		this.ms = e
	}, n.prototype.setMax = function(e) {
		this.max = e
	}, n.prototype.setJitter = function(e) {
		this.jitter = e
	}
}, function(e, t) {
	e.exports = function(e) {
		return e.webpackPolyfill || (e.deprecate = function() {}, e.paths = [], e.children || (e
			.children = []), Object.defineProperty(e, "loaded", {
			enumerable: !0,
			get: function() {
				return e.l
			}
		}), Object.defineProperty(e, "id", {
			enumerable: !0,
			get: function() {
				return e.i
			}
		}), e.webpackPolyfill = 1), e
	}
}, function(e, t, n) {
	var s = n(12).fn,
		r = n(4),
		i = n(11),
		o = n(26),
		a = n(5),
		c = n(1),
		m = n(9),
		u = n(0),
		l = u.notundef;
	var d;
	s.login = function() {
		this.doLogin()
	}, s.doLogin = function() {
		var e = this;
		Promise.resolve().then(() => e.assembleLogin()).then(t => {
			const n = this.socket && this.socket.socket && this.socket.socket.sessionid;
			if (n) {
				if (this.socketIds || (this.socketIds = {}), this.socketIds[n]) return void this
					.logger.warn("onConnect::repeat login", n);
				this.socketIds[n] = !0
			} else this.logger.warn("onConnect:: no socketId ", this.socket && this.socket
				.socket);
			this.logger.warn("link::doLogin: " + n + " appLogin is " + t.login.appLogin), e
				.sendCmd("login", {
					...t
				}, e.onLogin.bind(e))
		})
	}, s.genSessionKey = (d = {}, function() {
		var e = this.name;
		return d[e] = d[e] || u.guid()
	}), s.assembleIMLogin = function() {
		var e = this.options,
			t = e.account;
		this.sdkSession = this.genSessionKey();
		var n = {
			appLogin: this.autoconnect ? 0 : 1,
			appKey: e.appKey,
			account: t,
			token: e.token,
			sdkVersion: c.info.sdkVersion,
			sdkHumanVersion: c.info.sdkHumanVersion,
			protocolVersion: c.info.protocolVersion,
			os: "[object Object]" === i.os.toString() ? i.os.family : i.os.toString(),
			browser: i.name + " " + i.version,
			clientType: c.CLIENTTYPE || 16,
			session: this.sdkSession,
			deviceId: a.deviceId,
			isReactNative: c.isRN ? 1 : 0,
			customTag: e.customTag || "",
			sdkType: 0
		};
		return n.userAgent = "Native/" + c.info.sdkHumanVersion, c.isBrowser ? n.sdkType = 0 : c.isRN ?
			n.sdkType = 2 : c.isWeixinApp && (n.sdkType = 6), e.customClientType && (n
				.customClientType = +e.customClientType), e.authType && (n.authType = +e.authType), e
			.loginExt && (n.loginExt = e.loginExt), n
	}, s.onLogin = function(e, t) {
		var n = this,
			s = 0;
		n.loginResult = t, e ? t && !t.chatroom && (m.updateUniErrCache("login", {
			operation_type: "protocol",
			error: e
		}), m.concludeUniErrCache("login", 1), n.onAuthError(e, "link::onLogin")) : (this
			.heartbeatFail = 0, this.hasLogin = !0, this.autoconnect = !0, n.startHeartbeat(), n
			.afterLogin(t), n.initOnlineListener(), s = 5e3, t.chatroom || (m.updateUniSuccCache(
				"login", {
					operation_type: "protocol",
					target: "2-2"
				}), m.concludeUniErrCache("login", 0))), !0 === n.options.logReport && setTimeout(
		() => {
				var e = {
					appKey: n.options.appKey,
					sdk_ver: c.info.version,
					deviceId: a.deviceId
				};
				t.chatroom || m.reportErrEvent(e)
			}, s)
	}, s.afterLogin = u.emptyFunc, s.notifyLogin = function() {
		var e = this.loginResult;
		this.logger.info("link::notifyLogin: on connect", e);
		try {
			this.options.onconnect(e)
		} catch (e) {
			throw this.logger.error("userOption:onconnect function error", e), e
		}
	}, s.logout = function() {
		m.pause();
		var e = "done disconnect";
		if (this.doLogout) return this.doLogout = !1, e = "done logout", void this.onAuthError(new r(e,
			"logout"), "link::logout");
		if (this.isConnected()) {
			var t = new r(e, "logout");
			this.onAuthError(t, "link::logout")
		}
	}, s.onKicked = function(e) {
		var t = e.content,
			n = t.from,
			s = t.reason,
			i = t.custom,
			a = t.customClientType,
			c = {
				reason: this.kickedReasons[s] || "unknown",
				message: this.kickedMessages[s] || "未知原因"
			};
		if (l(n) && (c.from = o.reverseType(n)), l(i) && (c.custom = i), +a > 0 && (c.customClientType =
				a), this.logger.warn("link::onKicked:", c), "silentlyKick" !== c.reason) {
			var m = new r("被踢了", "kicked");
			u.merge(m, c), this.onAuthError(m, "link::onKicked")
		} else this.logger.warn("link::onKicked: silentlyKick"), this.forceDisconnect(), this
			.onDisconnect("link::onKicked")
	}, s.onAuthError = function(e, t) {
		var n = e && e.code;
		if (this.logger.error("onAuthError ", t, n),
			/^(Error_Internet_Disconnected|Error_Timeout|Error_Connection_Socket_State_not_Match)$/
			.test(n)) return this.forceDisconnect(), void this.onDisconnect("link::onAuthError::" + n);
		(e = e || r.newConnectionError({
			callFunc: t
		})).callFunc = e.callFunc || t || null, this.shouldReconnect = !1, this.markAllCallbackInvalid(
			e), this.notifyDisconnect(e)
	}
}, function(e, t, n) {
	var s = n(12).fn,
		r = n(1);
	s.processLink = function(e) {
			switch (e.cmd) {
				case "heartbeat":
					this.startHeartbeat()
			}
		}, s.startHeartbeat = function() {
			var e = this;
			e.stopHeartbeat(), e.heartbeatTimer = setTimeout((function() {
				e.sendCmd("heartbeat", null, e.onHeartbeat.bind(e))
			}), r.heartbeatInterval)
		}, s.stopHeartbeat = function() {
			this.heartbeatTimer && (clearTimeout(this.heartbeatTimer), this.heartbeatTimer = null)
		}, s.onHeartbeat = function(e, t) {
			if (e) {
				if (this.syncing) return this.logger.warn("onHeartbeat::ignore error in connecting"),
					void this.startHeartbeat();
				e.callFunc = "link::onHeartbeat", this.onCustomError("heartbeat error", e), this
					.heartbeatFail++, this.logger.warn("onHeartbeat::error ", e.code, e),
					"Error_Timeout" === e.code && (this.getOnlineStatus() ? this.heartbeatFail > 1 ? (this
						.forceDisconnect(), this.onDisconnect("link::onHeartbeat")) : this.sendCmd(
						"heartbeat", null, this.onHeartbeat.bind(this)) : this.startHeartbeat())
			} else this.heartbeatFail = 0
		}, s.getOnlineStatus = "undefined" != typeof navigator && "boolean" == typeof navigator.onLine ?
	() => navigator.onLine : () => !0, s.heartbeat = function() {}
}, function(e, t, n) {
	var s = n(12).fn,
		r = n(44),
		i = n(1),
		o = (n(0), n(5));
	s.processMisc = function(e) {
		switch (e.cmd) {
			case "getSimpleNosToken":
				e.error || (e.obj = e.content.nosTokens[0]);
				break;
			case "getNosToken":
				e.error || (e.obj = e.content.nosToken);
				break;
			case "getGrayscaleConfig":
				e.error || (e.obj = e.content.appGrayConfigTag);
				break;
			case "getMixStorePolicy":
				e.error || (e.obj = e.content.mixStorePolicyTag);
				break;
			case "getMixStoreToken":
				e.error || (e.obj = e.content.mixStoreTokenTag);
				break;
			case "getBackSourceToken":
				e.error || (e.obj = e.content.backSourceTokenTag);
				break;
			case "uploadSdkLogUrl":
				e.error ? this.logger.error("uploadSdkLogUrl::error", e.error) : this.logger.info(
					"uploadSdkLogUrl::success", e.obj && e.obj.url);
				break;
			case "notifyUploadLog":
				e.error || (i.isRN ? this.uploadLocalLogRN() : i.isBrowser && this.uploadLocalLogWeb(),
					this.emitAPI({
						type: "notifyUploadLog"
					}));
				break;
			case "audioToText":
				e.error || (e.obj.text = e.content.text);
				break;
			case "processImage":
				e.obj.imageOps = r.reverseImageOps(e.obj.imageOps), e.error || (e.obj = {
					url: e.content.url
				});
				break;
			case "getNosTokenTrans":
				e.error || (e.obj = {
					nosToken: e.content.nosToken,
					docId: e.content.docId
				});
				break;
			case "getNosOriginUrl":
				e.error || (e.obj = e.content.nosFileUrlTag.originUrl);
				break;
			case "notifyTransLog":
				e.error || this.emitAPI({
					type: "notifyTransLog",
					obj: e.content.transInfo
				});
				break;
			case "fetchFile":
			case "fetchFileList":
			case "removeFile":
				e.error || (e.obj = e.content);
				break;
			case "getServerTime":
				e.obj = e.content && e.content.time;
				break;
			case "getNosCdnHost":
				this.getNosCdnHost(e)
		}
	}, s.uploadLocalLogRN = function(e) {
		if (i.isRN && o.rnfs) {
			var t = o.rnfs,
				n = this,
				s = t.nimIndex,
				r = (t.nimIndex + 1) % 2;
			t.nimPromise = t.nimPromise.then(() => Promise.all([t.exists(a(s)), t.exists(a(r))])).then(
				e => e && (e[0] || e[1]) ? e[0] && e[1] ? t.copyFile(a(r), a(2)).then(() => t
					.readFile(a(s))).then(e => t.appendFile(a(2), e)) : e[0] ? t.copyFile(a(s), a(
					2)) : void(e[1] && t.copyFile(a(r), a(2))) : Promise.reject()).then(e =>
				new Promise((e, s) => {
					n.api.previewFile({
						filePath: a(2),
						done: function(s, r) {
							if (Promise.all([t.unlink(a(2)), t.unlink(a(1)), t
									.unlink(a(0))
								]).finally(() => {
									e()
								}), s) n.logger.error(
								"nim::uploadLocalLogRN:previewFile:error", s);
							else {
								var i = r.url;
								i.indexOf("?") > 0 ? i += "&" : i += "?", i +=
									"download=" + (new Date).getTime() + "_rn.log",
									n.api.uploadSdkLogUrl({
										url: i
									})
							}
						}
					})
				})).catch(e => {
				t.unlink(a(2)).catch((function(e) {})), n.logger.error(
					"nim::protocol::uploadLocalLogRN", e)
			})
		}

		function a(e) {
			return t.DocumentDirectoryPath + "/nimlog_" + e + ".log"
		}
	}, s.uploadLocalLogWeb = function() {
		!1 !== this.options.dbLog && this.logger._local ? this.logger._local.fetchLog().then(e => {
			this.api.previewFile({
				blob: new Blob([e.logs], {
					type: "text/plain"
				}),
				done: (t, n) => {
					if (t) this.logger.error("uploadLocalLogWeb::previewFile:error",
						t);
					else {
						this.logger.log("uploadLocalLogWeb::previewFile:success",
						n);
						var s = n.url;
						s += (s.indexOf("?") > 0 ? "&" : "?") + "download=" + (
								new Date).getTime() + "_web.log", this.api
							.uploadSdkLogUrl({
								url: s
							}), this.logger._local.deleteLogs(e.time).then(() => {
								this.logger.log(
									"uploadLocalLogWeb::deleteLogs success")
							}).catch(e => this.logger.error(
								"uploadLocalLogWeb::deleteLogs:error ,", e))
					}
				}
			})
		}).catch(e => {
			this.logger.error("uploadLocalLogWeb::fetchLog:error", e)
		}) : this.logger.warn("uploadLocalLogWeb::no dbLog")
	}, s.getNosCdnHost = function(e) {
		let t = this,
			n = e.error;
		if (n && (n.callFunc = "events::getNosCdnHost", t.onCustomError("getNosCdnHost",
				"EVENT_GET_NOS_CDN_HOST_ERROR", n)), !e.content || !e.content.nosConfigTag) return;
		let s = e.content.nosConfigTag,
			r = "",
			o = "";
		0 !== s.expire && s.cdnDomain ? -1 === s.expire ? (r = s.cdnDomain, o = s.objectNamePrefix) : (
				r = s.cdnDomain, o = s.objectNamePrefix, t.nosCdnHostTimer && clearTimeout(t
					.nosCdnHostTimer), t.nosCdnHostTimer = setTimeout((function() {
					t.sendCmd("getNosCdnHost", {})
				}), 800 * parseInt(s.expire))) : (r = "", o = ""), i.serverNosConfig.cdnDomain = r, i
			.serverNosConfig.objectPrefix = o, i.hasLocalStorage && (localStorage.setItem(
				"nim_cdn_domain", r), localStorage.setItem("nim_object_prefix", o))
	}
}, function(e, t, n) {
	const s = n(12).fn,
		r = n(0),
		i = n(45);
	s.processAvSignal = function(e) {
		switch (e.cmd) {
			case "signalingCreate":
			case "signalingDelay":
			case "signalingClose":
			case "signalingJoin":
			case "signalingLeave":
			case "signalingInvite":
			case "signalingCancel":
			case "signalingReject":
			case "signalingAccept":
			case "signalingControl":
			case "signalingSyncMsgRead":
			case "signalingGetChannelInfo":
				break;
			case "signalingNotify":
				this.onSignalingNotify(e);
				break;
			case "signalingMutilClientSyncNotify":
				this.onSignalingMutilClientSyncNotify(e);
				break;
			case "signalingUnreadMessageSyncNotify":
				this.onSignalingUnreadMessageSyncNotify(e);
				break;
			case "signalingChannelsSyncNotify":
				this.onSignalingMembersSyncNotify(e);
				break;
			default:
				this.logger.warn("avSignal::unhandled cmd:", e.cmd)
		}
	};
	const o = (e = {}) => {
		if (e.needPush && (e.needPush = "1" === e.needPush), e.needBadge && (e.needBadge = "1" === e
				.needBadge), e.channelInValid && (e.channelInValid = "1" === e.channelInValid), e
			.attach) {
			const t = JSON.parse(e.attach);
			e.eventType = i.parseAvSignalType(t.type)
		}
		if (e.members) {
			const t = JSON.parse(e.members);
			e.members = t.map(e => i.parseAvSignalMember(e))
		}
		return e
	};
	s.onSignalingNotify = function(e) {
		if (e.error) {
			const t = e.error;
			this.logger.error("protocal::avSignal:onSignalingNotify error", t), this.emitAPI({
				type: "error",
				error: t
			}), this.options.onerror(t)
		} else {
			e.raw && e.raw.r && e.raw.r.length && e.content && e.content.avSignalTag && (e.content
				.avSignalTag.msgid = e.raw.r[0]);
			let {
				avSignalTag: t
			} = e.content;
			t = Array.isArray(t) ? t.map(e => o(e)) : o(t), this.emitAPI({
				type: "signalingNotify",
				obj: t
			}), r.isFunction(this.options.onSignalingNotify) && this.options.onSignalingNotify(t)
		}
	}, s.onSignalingMutilClientSyncNotify = function(e) {
		if (e.error) {
			const t = e.error;
			this.logger.error("protocal::avSignal:onSignalingMutilClientSyncNotify error", t), this
				.emitAPI({
					type: "error",
					error: t
				}), this.options.onerror(t)
		} else {
			let {
				avSignalTag: t
			} = e.content;
			t = Array.isArray(t) ? t.map(e => o(e)) : o(t), this.emitAPI({
					type: "signalingMutilClientSyncNotify",
					obj: t
				}), r.isFunction(this.options.onSignalingMutilClientSyncNotify) && this.options
				.onSignalingMutilClientSyncNotify(t)
		}
	}, s.onSignalingUnreadMessageSyncNotify = function(e) {
		if (e.error) {
			const t = e.error;
			this.logger.error("protocal::avSignal:onSignalingUnreadMessageSyncNotify error", t), this
				.emitAPI({
					type: "error",
					error: t
				}), this.options.onerror(t)
		} else {
			let {
				avSignalTag: t
			} = e.content;
			Array.isArray(t) && (t = t.map(e => o(e))), this.emitAPI({
					type: "signalingUnreadMessageSyncNotify",
					obj: t
				}), r.isFunction(this.options.onSignalingUnreadMessageSyncNotify) && this.options
				.onSignalingUnreadMessageSyncNotify(t)
		}
	}, s.onSignalingMembersSyncNotify = function(e) {
		if (e.error) {
			const t = e.error;
			this.logger.error("protocal::avSignal:onSignalingMembersSyncNotify error", t), this
		.emitAPI({
				type: "error",
				error: t
			}), this.options.onerror(t)
		} else {
			let {
				avSignalTag: t
			} = e.content;
			Array.isArray(t) || (t = [t]), t = t.map(e => o(e)), this.emitAPI({
					type: "signalingChannelsSyncNotify",
					obj: t
				}), r.isFunction(this.options.onSignalingMembersSyncNotify) && this.options
				.onSignalingMembersSyncNotify(t)
		}
	}
}, function(e, t) {
	e.exports = {
		negotiateTransportTag: {
			version: -1,
			serializeList: 1,
			serialize: 101
		},
		initTransportTag: {},
		nosToken: {
			objectName: 1,
			token: 2,
			bucket: 3,
			expireTime: 4,
			expireSec: 7,
			tag: 8,
			shortUrl: 9
		},
		audioToText: {
			url: 2
		},
		imageOp: {
			type: 0,
			stripmeta: 1,
			typeType: 2,
			blurRadius: 3,
			blurSigma: 4,
			qualityQuality: 5,
			cropX: 6,
			cropY: 7,
			cropWidth: 8,
			cropHeight: 9,
			rotateAngle: 10,
			pixelPixel: 11,
			thumbnailMode: 12,
			thumbnailWidth: 13,
			thumbnailHeight: 14,
			thumbnailAxisX: 15,
			thumbnailAxisY: 16,
			thumbnailCenterX: 17,
			thumbnailCenterY: 18,
			thumbnailEnlarge: 19,
			thumbnailToStatic: 20,
			watermarkType: 21,
			watermarkGravity: 22,
			watermarkDissolve: 23,
			watermarkDx: 24,
			watermarkDy: 25,
			watermarkImage: 26,
			watermarkText: 27,
			watermarkFont: 28,
			watermarkFontSize: 29,
			watermarkFontColor: 30,
			interlace: 31
		},
		robot: {
			account: 4,
			nick: 5,
			avatar: 6,
			intro: 7,
			config: 8,
			valid: 9,
			createTime: 10,
			updateTime: 11,
			custid: 12,
			botid: 13,
			bindTime: 14
		},
		clientAntispam: {
			version: 1,
			md5: 2,
			nosurl: 3,
			thesaurus: 4
		},
		fileQuickTransfer: {
			md5: 1,
			url: 2,
			size: 3,
			threshold: 4
		},
		transToken: {
			name: 1,
			type: 2,
			transType: 3,
			size: 4,
			extra: 5,
			body: 6
		},
		transInfo: {
			docId: 1,
			name: 2,
			prefix: 3,
			size: 4,
			type: 5,
			state: 6,
			transType: 7,
			transSize: 8,
			pageCount: 9,
			picInfo: 10,
			extra: 11,
			flag: 12
		},
		nosFileUrlTag: {
			safeUrl: 0,
			originUrl: 1
		},
		nosAccessTokenTag: {
			token: 0,
			url: 1,
			userAgent: 2,
			ext: 3
		},
		fileListParam: {
			fromDocId: 1,
			limit: 2
		},
		avSignalTag: {
			type: 1,
			channelName: 2,
			channelId: 3,
			channelCreateTime: 4,
			channelExpireTime: 5,
			creator: 6,
			ext: 7,
			channelInValid: 8,
			from: 10,
			to: 11,
			requestId: 12,
			needPush: 13,
			pushTitle: 14,
			pushContent: 15,
			pushPayload: 16,
			needBadge: 17,
			members: 18,
			attach: 19,
			attachExt: 20,
			isSave: 21,
			msgid: 22,
			uid: 23,
			time: 24
		},
		login: {
			clientType: 3,
			os: 4,
			sdkVersion: 6,
			appLogin: 8,
			protocolVersion: 9,
			pushTokenName: 10,
			pushToken: 11,
			deviceId: 13,
			appKey: 18,
			account: 19,
			browser: 24,
			session: 26,
			deviceInfo: 32,
			sdkType: 41,
			userAgent: 42,
			isReactNative: 112,
			token: 1e3,
			customTag: 38,
			customClientType: 39,
			sdkHumanVersion: 40,
			authType: 115,
			loginExt: 116
		},
		loginRes: {
			lastLoginDeviceId: 17,
			customTag: 38,
			connectionId: 102,
			ip: 103,
			port: 104,
			country: 106,
			hasXMPush: 111
		},
		loginPort: {
			type: 3,
			os: 4,
			mac: 5,
			deviceId: 13,
			account: 19,
			deviceInfo: 32,
			connectionId: 102,
			ip: 103,
			time: 109,
			customTag: 38,
			customClientType: 39
		},
		aosPushInfo: {
			pushType: 110,
			hasTokenPreviously: 111
		},
		sync: {
			myInfo: 1,
			offlineMsgs: 2,
			teams: 3,
			netcallMsgs: 6,
			roamingMsgs: 7,
			relations: 9,
			friends: 11,
			sessions: 12,
			friendUsers: 13,
			msgReceipts: 14,
			myTeamMembers: 15,
			donnop: 16,
			deleteMsg: 17,
			sessionAck: 18,
			robots: 19,
			broadcastMsgs: 20,
			avSignal: 21,
			superTeams: 22,
			myInfoInSuperTeams: 23,
			superTeamRoamingMsgs: 24,
			deleteSuperTeamMsg: 25,
			superTeamSessionAck: 26,
			deleteMsgSelf: 27,
			stickTopSessions: 28,
			sessionHistoryMsgsDelete: 29,
			filterMsgs: 100
		},
		donnop: {
			open: 1
		},
		sessionReqTag: {
			minTimestamp: 1,
			maxTimestamp: 2,
			needLastMsg: 3,
			limit: 4,
			hasMore: 5
		},
		session: {
			id: 1,
			updateTime: 2,
			ext: 3,
			lastMsg: 4
		},
		superTeam: {
			teamId: 1,
			name: 3,
			type: 4,
			owner: 5,
			level: 6,
			selfCustom: 7,
			valid: 8,
			memberNum: 9,
			memberUpdateTime: 10,
			createTime: 11,
			updateTime: 12,
			validToCurrentUser: 13,
			intro: 14,
			announcement: 15,
			joinMode: 16,
			bits: 17,
			custom: 18,
			serverCustom: 19,
			avatar: 20,
			beInviteMode: 21,
			inviteMode: 22,
			updateTeamMode: 23,
			updateCustomMode: 24,
			mute: 100,
			muteType: 101
		},
		superTeamMember: {
			teamId: 1,
			account: 3,
			type: 4,
			nickInTeam: 5,
			bits: 7,
			active: 8,
			valid: 9,
			createTime: 10,
			updateTime: 11,
			custom: 12,
			mute: 13,
			invitoraccid: 14,
			joinTime: 15
		},
		team: {
			teamId: 1,
			name: 3,
			type: 4,
			owner: 5,
			level: 6,
			selfCustom: 7,
			valid: 8,
			memberNum: 9,
			memberUpdateTime: 10,
			createTime: 11,
			updateTime: 12,
			validToCurrentUser: 13,
			intro: 14,
			announcement: 15,
			joinMode: 16,
			bits: 17,
			custom: 18,
			serverCustom: 19,
			avatar: 20,
			beInviteMode: 21,
			inviteMode: 22,
			updateTeamMode: 23,
			updateCustomMode: 24,
			mute: 100,
			muteType: 101
		},
		teamMember: {
			teamId: 1,
			account: 3,
			type: 4,
			nickInTeam: 5,
			bits: 7,
			active: 8,
			valid: 9,
			joinTime: 10,
			updateTime: 11,
			custom: 12,
			mute: 13,
			invitorAccid: 14
		},
		msg: {
			scene: 0,
			to: 1,
			from: 2,
			fromClientType: 4,
			fromDeviceId: 5,
			fromNick: 6,
			time: 7,
			type: 8,
			body: 9,
			attach: 10,
			idClient: 11,
			idServer: 12,
			resend: 13,
			userUpdateTime: 14,
			custom: 15,
			pushPayload: 16,
			pushContent: 17,
			apnsAccounts: 18,
			apnsContent: 19,
			apnsForcePush: 20,
			yidunEnable: 21,
			antiSpamContent: 22,
			antiSpamBusinessId: 23,
			clientAntiSpam: 24,
			antiSpamUsingYidun: 25,
			needMsgReceipt: 26,
			needUpdateSession: 28,
			replyMsgFromAccount: 29,
			replyMsgToAccount: 30,
			replyMsgTime: 31,
			replyMsgIdServer: 32,
			replyMsgIdClient: 33,
			threadMsgFromAccount: 34,
			threadMsgToAccount: 35,
			threadMsgTime: 36,
			threadMsgIdServer: 37,
			threadMsgIdClient: 38,
			delete: 39,
			callbackExt: 40,
			subType: 41,
			yidunAntiCheating: 42,
			env: 43,
			yidunAntiSpamExt: 44,
			yidunAntiSpamRes: 45,
			isHistoryable: 100,
			isRoamingable: 101,
			isSyncable: 102,
			isMuted: 104,
			cc: 105,
			isInBlackList: 106,
			isPushable: 107,
			isOfflinable: 108,
			isUnreadable: 109,
			needPushNick: 110,
			isReplyMsg: 111,
			tempTeamMemberCount: 112
		},
		threadMsgReq: {
			beginTime: 1,
			endTime: 2,
			lastMsgId: 3,
			limit: 4,
			reverse: 5
		},
		threadMsgsMeta: {
			total: 1,
			lastMsgTime: 2
		},
		comment: {
			from: 1,
			body: 2,
			time: 3,
			custom: 4,
			needPush: 5,
			needBadge: 6,
			pushTitle: 7,
			apnsText: 8,
			pushPayload: 9
		},
		commentReq: {
			scene: 1,
			from: 2,
			to: 3,
			time: 4,
			idServer: 5,
			idClient: 6,
			timestamp: 100
		},
		commentRes: {
			scene: 1,
			from: 2,
			to: 3,
			time: 4,
			idServer: 5,
			idClient: 6,
			detail: 7,
			modify: 8,
			timestamp: 100
		},
		collect: {
			id: 1,
			type: 2,
			data: 3,
			custom: 4,
			uniqueId: 5,
			createTime: 6,
			updateTime: 7
		},
		collectQuery: {
			beginTime: 1,
			endTime: 2,
			lastMsgId: 3,
			limit: 4,
			reverse: 5,
			type: 6
		},
		stickTopSession: {
			id: 1,
			topCustom: 2,
			createTime: 3,
			updateTime: 4
		},
		pinTag: {
			pinFrom: 1,
			pinCustom: 2,
			createTime: 3,
			updateTime: 4
		},
		msgPinReq: {
			sessionId: 1,
			timetag: 2
		},
		msgPinRes: {
			scene: 1,
			from: 2,
			to: 3,
			time: 4,
			idServer: 5,
			idClient: 6,
			pinFrom: 7,
			pinCustom: 8
		},
		msgReceipt: {
			to: 1,
			from: 2,
			time: 7,
			idClient: 11
		},
		teamMsgReceipt: {
			teamId: 0,
			idServer: 1,
			read: 100,
			unread: 101,
			idClient: 102,
			account: 103
		},
		deleteMsgSelfTag: {
			scene: 1,
			from: 2,
			to: 3,
			idServer: 4,
			idClient: 5,
			time: 6,
			deletedTime: 7,
			custom: 8
		},
		sysMsg: {
			time: 0,
			type: 1,
			to: 2,
			from: 3,
			ps: 4,
			attach: 5,
			idServer: 6,
			sendToOnlineUsersOnly: 7,
			apnsText: 8,
			pushPayload: 9,
			deletedIdClient: 10,
			deletedIdServer: 11,
			yidunEnable: 12,
			antiSpamContent: 13,
			deletedMsgTime: 14,
			deletedMsgFromNick: 15,
			opeAccount: 16,
			env: 21,
			callbackExt: 22,
			cc: 105,
			isPushable: 107,
			isUnreadable: 109,
			needPushNick: 110
		},
		broadcastMsg: {
			broadcastId: 1,
			fromAccid: 2,
			fromUid: 3,
			timestamp: 4,
			body: 5
		},
		friend: {
			account: 4,
			flag: 5,
			beflag: 6,
			source: 7,
			alias: 8,
			bits: 9,
			custom: 10,
			createTime: 11,
			updateTime: 12,
			serverex: 13
		},
		user: {
			account: 1,
			nick: 3,
			avatar: 4,
			sign: 5,
			gender: 6,
			email: 7,
			birth: 8,
			tel: 9,
			custom: 10,
			createTime: 12,
			updateTime: 13
		},
		antispamTag: {
			antiSpamBusinessId: 1
		},
		specialRelation: {
			account: 0,
			isMuted: 1,
			isBlacked: 2,
			createTime: 3,
			updateTime: 4
		},
		msgType: {
			text: 0,
			picture: 1,
			audio: 2,
			video: 3,
			location: 4,
			notification: 5,
			file: 6,
			netcall_audio: 7,
			netcall_vedio: 8,
			datatunnel_new: 9,
			tips: 10,
			robot: 11,
			custom: 100
		},
		msgEvent: {
			type: 1,
			value: 2,
			idClient: 3,
			custom: 4,
			validTime: 5,
			broadcastType: 6,
			sync: 7,
			validTimeType: 8,
			durable: 9,
			time: 10,
			idServer: 11,
			clientType: 12,
			serverConfig: 13,
			serverCustom: 14,
			appid: 101,
			account: 103,
			enableMultiClient: 104,
			consid: 106
		},
		msgEventSubscribe: {
			type: 1,
			subscribeTime: 2,
			sync: 3,
			to: 102,
			from: 104,
			time: 105
		},
		clearMsgsParams: {
			account: 1,
			delRoam: 2
		},
		clearMsgsParamsWithSync: {
			type: 0,
			otherAccid: 1,
			isDeleteRoam: 2,
			toTid: 3,
			isSyncSelf: 4,
			fromAccid: 5,
			time: 6,
			ext: 7
		},
		msgFullSearchRequestTag: {
			keyword: 1,
			fromTime: 2,
			toTime: 3,
			sessionLimit: 4,
			msgLimit: 5,
			order: 6,
			p2pList: 7,
			teamList: 8,
			senderList: 9,
			msgTypeList: 10,
			msgSubTypeList: 11
		},
		msgTimingFullSearchRequestTag: {
			keyword: 1,
			fromTime: 2,
			toTime: 3,
			msgLimit: 5,
			order: 6,
			p2pList: 7,
			teamList: 8,
			senderList: 9,
			msgTypeList: 10,
			msgSubTypeList: 11
		},
		delFriendParams: {
			delAlias: 1
		},
		proxyTag: {
			zone: 1,
			path: 2,
			method: 3,
			header: 4,
			body: 5
		},
		proxyMsgTag: {
			from: 1,
			body: 2,
			time: 3
		},
		sessionAckTag: {
			scene: 1,
			to: 2,
			timetag: 3
		},
		mixTokenReq: {
			provider: 0,
			tokenCount: 1,
			fileExpireSec: 2,
			tag: 3,
			returnBody: 4
		},
		mixAuthTokenReq: {
			type: 1,
			urls: 2
		},
		getQChatAddressTag: {
			ipType: 1
		}
	}
}, function(e, t) {
	e.exports = {
		negotiateTransportTag: {
			"-1": "version",
			1: "serializeList",
			101: "serialize"
		},
		initTransportTag: {},
		nosToken: {
			1: "objectName",
			2: "token",
			3: "bucket",
			4: "expireTime",
			7: "expireSec",
			8: "tag",
			9: "shortUrl"
		},
		audioToText: {
			2: "url"
		},
		imageOp: {
			0: "type",
			1: "stripmeta",
			2: "typeType",
			3: "blurRadius",
			4: "blurSigma",
			5: "qualityQuality",
			6: "cropX",
			7: "cropY",
			8: "cropWidth",
			9: "cropHeight",
			10: "rotateAngle",
			11: "pixelPixel",
			12: "thumbnailMode",
			13: "thumbnailWidth",
			14: "thumbnailHeight",
			15: "thumbnailAxisX",
			16: "thumbnailAxisY",
			17: "thumbnailCenterX",
			18: "thumbnailCenterY",
			19: "thumbnailEnlarge",
			20: "thumbnailToStatic",
			21: "watermarkType",
			22: "watermarkGravity",
			23: "watermarkDissolve",
			24: "watermarkDx",
			25: "watermarkDy",
			26: "watermarkImage",
			27: "watermarkText",
			28: "watermarkFont",
			29: "watermarkFontSize",
			30: "watermarkFontColor",
			31: "interlace"
		},
		robot: {
			4: "account",
			5: "nick",
			6: "avatar",
			7: "intro",
			8: "config",
			9: "valid",
			10: "createTime",
			11: "updateTime",
			12: "custid",
			13: "botid",
			14: "bindTime",
			_6_safe: "_avatar_safe"
		},
		clientAntispam: {
			1: "version",
			2: "md5",
			3: "nosurl",
			4: "thesaurus"
		},
		fileQuickTransfer: {
			1: "md5",
			2: "url",
			3: "size",
			4: "threshold",
			_2_safe: "_url_safe"
		},
		transToken: {
			1: "name",
			2: "type",
			3: "transType",
			4: "size",
			5: "extra",
			6: "body"
		},
		transInfo: {
			1: "docId",
			2: "name",
			3: "prefix",
			4: "size",
			5: "type",
			6: "state",
			7: "transType",
			8: "transSize",
			9: "pageCount",
			10: "picInfo",
			11: "extra",
			12: "flag"
		},
		nosFileUrlTag: {
			0: "safeUrl",
			1: "originUrl"
		},
		nosAccessTokenTag: {
			0: "token",
			1: "url",
			2: "userAgent",
			3: "ext"
		},
		nosConfigTag: {
			1: "bucket",
			2: "cdnDomain",
			3: "expire",
			4: "objectNamePrefix"
		},
		appGrayConfigTag: {
			0: "grayConfig",
			1: "ttl"
		},
		mixStorePolicyTag: {
			0: "providers",
			1: "ttl",
			2: "mixEnable",
			3: "nosPolicy",
			4: "s3Policy"
		},
		mixStoreTokenTag: {
			0: "provider",
			1: "accessKeyId",
			2: "secretAccessKey",
			3: "sessionToken",
			4: "token",
			5: "expireAt",
			6: "bucket",
			7: "objectName",
			8: "fileExpireSec",
			9: "tag",
			10: "shortUrl",
			11: "region"
		},
		backSourceTokenTag: {
			1: "type",
			2: "tokens",
			3: "token",
			4: "ttl"
		},
		fileListParam: {
			1: "fromDocId",
			2: "limit"
		},
		avSignalTag: {
			1: "type",
			2: "channelName",
			3: "channelId",
			4: "channelCreateTime",
			5: "channelExpireTime",
			6: "creator",
			7: "ext",
			8: "channelInValid",
			10: "from",
			11: "to",
			12: "requestId",
			13: "needPush",
			14: "pushTitle",
			15: "pushContent",
			16: "pushPayload",
			17: "needBadge",
			18: "members",
			19: "attach",
			20: "attachExt",
			21: "isSave",
			22: "msgid",
			23: "uid",
			24: "time"
		},
		login: {
			3: "clientType",
			4: "os",
			6: "sdkVersion",
			8: "appLogin",
			9: "protocolVersion",
			10: "pushTokenName",
			11: "pushToken",
			13: "deviceId",
			18: "appKey",
			19: "account",
			24: "browser",
			26: "session",
			32: "deviceInfo",
			38: "customTag",
			39: "customClientType",
			40: "sdkHumanVersion",
			112: "isReactNative",
			115: "authType",
			116: "loginExt",
			1e3: "token"
		},
		loginRes: {
			17: "lastLoginDeviceId",
			38: "customTag",
			102: "connectionId",
			103: "ip",
			104: "port",
			106: "country",
			111: "hasXMPush"
		},
		loginPort: {
			3: "type",
			4: "os",
			5: "mac",
			13: "deviceId",
			19: "account",
			32: "deviceInfo",
			38: "customTag",
			39: "customClientType",
			102: "connectionId",
			103: "ip",
			109: "time"
		},
		aosPushInfo: {
			110: "pushType",
			111: "hasTokenPreviously"
		},
		sync: {
			1: "myInfo",
			2: "offlineMsgs",
			3: "teams",
			6: "netcallMsgs",
			7: "roamingMsgs",
			9: "relations",
			11: "friends",
			12: "sessions",
			13: "friendUsers",
			14: "msgReceipts",
			15: "myTeamMembers",
			16: "donnop",
			17: "deleteMsg",
			18: "sessionAck",
			19: "robots",
			20: "broadcastMsgs",
			21: "avSignal",
			22: "superTeams",
			23: "myInfoInSuperTeams",
			24: "superTeamRoamingMsgs",
			25: "deleteSuperTeamMsg",
			26: "superTeamSessionAck",
			27: "deleteMsgSelf",
			28: "stickTopSessions",
			29: "sessionHistoryMsgsDelete",
			100: "filterMsgs"
		},
		donnop: {
			1: "open"
		},
		sessionReqTag: {
			1: "minTimestamp",
			2: "maxTimestamp",
			3: "needLastMsg",
			4: "limit",
			5: "hasMore"
		},
		session: {
			1: "id",
			2: "updateTime",
			3: "ext",
			4: "lastMsg",
			5: "lastMsgType"
		},
		superTeam: {
			1: "teamId",
			3: "name",
			4: "type",
			5: "owner",
			6: "level",
			7: "selfCustom",
			8: "valid",
			9: "memberNum",
			10: "memberUpdateTime",
			11: "createTime",
			12: "updateTime",
			13: "validToCurrentUser",
			14: "intro",
			15: "announcement",
			16: "joinMode",
			17: "bits",
			18: "custom",
			19: "serverCustom",
			20: "avatar",
			21: "beInviteMode",
			22: "inviteMode",
			23: "updateTeamMode",
			24: "updateCustomMode",
			100: "mute",
			101: "muteType",
			_20_safe: "_avatar_safe"
		},
		superTeamMember: {
			1: "teamId",
			3: "account",
			4: "type",
			5: "nickInTeam",
			7: "bits",
			8: "active",
			9: "valid",
			10: "createTime",
			11: "updateTime",
			12: "custom",
			13: "mute",
			14: "invitoraccid",
			15: "joinTime"
		},
		team: {
			1: "teamId",
			3: "name",
			4: "type",
			5: "owner",
			6: "level",
			7: "selfCustom",
			8: "valid",
			9: "memberNum",
			10: "memberUpdateTime",
			11: "createTime",
			12: "updateTime",
			13: "validToCurrentUser",
			14: "intro",
			15: "announcement",
			16: "joinMode",
			17: "bits",
			18: "custom",
			19: "serverCustom",
			20: "avatar",
			21: "beInviteMode",
			22: "inviteMode",
			23: "updateTeamMode",
			24: "updateCustomMode",
			100: "mute",
			101: "muteType",
			_20_safe: "_avatar_safe"
		},
		teamMember: {
			1: "teamId",
			3: "account",
			4: "type",
			5: "nickInTeam",
			7: "bits",
			8: "active",
			9: "valid",
			10: "joinTime",
			11: "updateTime",
			12: "custom",
			13: "mute",
			14: "invitorAccid"
		},
		msg: {
			0: "scene",
			1: "to",
			2: "from",
			4: "fromClientType",
			5: "fromDeviceId",
			6: "fromNick",
			7: "time",
			8: "type",
			9: "body",
			10: "attach",
			11: "idClient",
			12: "idServer",
			13: "resend",
			14: "userUpdateTime",
			15: "custom",
			16: "pushPayload",
			17: "pushContent",
			18: "apnsAccounts",
			19: "apnsContent",
			20: "apnsForcePush",
			21: "yidunEnable",
			22: "antiSpamContent",
			23: "antiSpamBusinessId",
			24: "clientAntiSpam",
			25: "antiSpamUsingYidun",
			26: "needMsgReceipt",
			28: "needUpdateSession",
			29: "replyMsgFromAccount",
			30: "replyMsgToAccount",
			31: "replyMsgTime",
			32: "replyMsgIdServer",
			33: "replyMsgIdClient",
			34: "threadMsgFromAccount",
			35: "threadMsgToAccount",
			36: "threadMsgTime",
			37: "threadMsgIdServer",
			38: "threadMsgIdClient",
			39: "delete",
			40: "callbackExt",
			41: "subType",
			42: "yidunAntiCheating",
			43: "env",
			44: "yidunAntiSpamExt",
			45: "yidunAntiSpamRes",
			100: "isHistoryable",
			101: "isRoamingable",
			102: "isSyncable",
			104: "isMuted",
			105: "cc",
			106: "isInBlackList",
			107: "isPushable",
			108: "isOfflinable",
			109: "isUnreadable",
			110: "needPushNick",
			111: "isReplyMsg",
			112: "tempTeamMemberCount"
		},
		threadMsgReq: {
			1: "beginTime",
			2: "endTime",
			3: "lastMsgId",
			4: "limit",
			5: "reverse"
		},
		threadMsgsMeta: {
			1: "total",
			2: "lastMsgTime"
		},
		comment: {
			1: "from",
			2: "body",
			3: "time",
			4: "custom",
			5: "needPush",
			6: "needBadge",
			7: "pushTitle",
			8: "apnsText",
			9: "pushPayload"
		},
		commentReq: {
			1: "scene",
			2: "from",
			3: "to",
			4: "time",
			5: "idServer",
			6: "idClient",
			100: "timestamp"
		},
		commentRes: {
			1: "scene",
			2: "from",
			3: "to",
			4: "time",
			5: "idServer",
			6: "idClient",
			7: "detail",
			8: "modify",
			100: "timestamp"
		},
		collect: {
			1: "id",
			2: "type",
			3: "data",
			4: "custom",
			5: "uniqueId",
			6: "createTime",
			7: "updateTime"
		},
		collectQuery: {
			1: "beginTime",
			2: "endTime",
			3: "lastMsgId",
			4: "limit",
			5: "reverse",
			6: "type"
		},
		stickTopSession: {
			1: "id",
			2: "topCustom",
			3: "createTime",
			4: "updateTime"
		},
		pinTag: {
			1: "pinFrom",
			2: "pinCustom",
			3: "createTime",
			4: "updateTime"
		},
		msgPinReq: {
			1: "sessionId",
			2: "timetag"
		},
		msgPinRes: {
			1: "scene",
			2: "from",
			3: "to",
			4: "time",
			5: "idServer",
			6: "idClient",
			7: "pinFrom",
			8: "pinCustom"
		},
		msgReceipt: {
			1: "to",
			2: "from",
			7: "time",
			11: "idClient"
		},
		teamMsgReceipt: {
			0: "teamId",
			1: "idServer",
			100: "read",
			101: "unread",
			102: "idClient",
			103: "account"
		},
		deleteMsgSelfTag: {
			1: "scene",
			2: "from",
			3: "to",
			4: "idServer",
			5: "idClient",
			6: "time",
			7: "deletedTime",
			8: "custom"
		},
		sysMsg: {
			0: "time",
			1: "type",
			2: "to",
			3: "from",
			4: "ps",
			5: "attach",
			6: "idServer",
			7: "sendToOnlineUsersOnly",
			8: "apnsText",
			9: "pushPayload",
			10: "deletedIdClient",
			11: "deletedIdServer",
			12: "yidunEnable",
			13: "antiSpamContent",
			14: "deletedMsgTime",
			15: "deletedMsgFromNick",
			16: "opeAccount",
			21: "env",
			22: "callbackExt",
			105: "cc",
			107: "isPushable",
			109: "isUnreadable",
			110: "needPushNick"
		},
		broadcastMsg: {
			1: "broadcastId",
			2: "fromAccid",
			3: "fromUid",
			4: "timestamp",
			5: "body"
		},
		friend: {
			4: "account",
			5: "flag",
			6: "beflag",
			7: "source",
			8: "alias",
			9: "bits",
			10: "custom",
			11: "createTime",
			12: "updateTime",
			13: "serverex"
		},
		user: {
			1: "account",
			3: "nick",
			4: "avatar",
			5: "sign",
			6: "gender",
			7: "email",
			8: "birth",
			9: "tel",
			10: "custom",
			12: "createTime",
			13: "updateTime",
			_4_safe: "_avatar_safe"
		},
		antispamTag: {
			antiSpamBusinessId: 1
		},
		specialRelation: {
			0: "account",
			1: "isMuted",
			2: "isBlacked",
			3: "createTime",
			4: "updateTime"
		},
		msgType: {
			0: "text",
			1: "picture",
			2: "audio",
			3: "video",
			4: "location",
			5: "notification",
			6: "file",
			7: "netcall_audio",
			8: "netcall_vedio",
			9: "datatunnel_new",
			10: "tips",
			11: "robot",
			100: "custom"
		},
		msgEvent: {
			1: "type",
			2: "value",
			3: "idClient",
			4: "custom",
			5: "validTime",
			6: "broadcastType",
			7: "sync",
			8: "validTimeType",
			9: "durable",
			10: "time",
			11: "idServer",
			12: "clientType",
			13: "serverConfig",
			14: "serverCustom",
			101: "appid",
			103: "account",
			104: "enableMultiClient",
			106: "consid"
		},
		msgEventSubscribe: {
			1: "type",
			2: "subscribeTime",
			3: "sync",
			102: "to",
			104: "from",
			105: "time"
		},
		clearMsgsParams: {
			1: "account",
			2: "delRoam"
		},
		clearMsgsParamsWithSync: {
			0: "type",
			1: "otherAccid",
			2: "delRoam",
			3: "toTid",
			4: "isSyncSelf",
			5: "fromAccid",
			6: "time",
			7: "ext"
		},
		msgFullSearchRequestTag: {
			1: "keyword",
			2: "fromTime",
			3: "toTime",
			4: "sessionLimit",
			5: "msgLimit",
			6: "order",
			7: "p2pList",
			8: "teamList",
			9: "senderList",
			10: "msgTypeList",
			11: "msgSubTypeList"
		},
		delFriendParams: {
			1: "delAlias"
		},
		proxyTag: {
			1: "zone",
			2: "path",
			3: "method",
			4: "header",
			5: "body"
		},
		proxyMsgTag: {
			1: "from",
			2: "body",
			3: "time"
		}
	}
}, function(e, t, n) {
	var s = n(0),
		r = n(24),
		i = s.merge({}, r.idMap, {
			chatroom: {
				id: 13,
				login: 2,
				kicked: 3,
				logout: 4,
				sendMsg: 6,
				msg: 7,
				getChatroomMembers: 8,
				getHistoryMsgs: 9,
				markChatroomMember: 11,
				closeChatroom: 12,
				getChatroom: 13,
				updateChatroom: 14,
				updateMyChatroomMemberInfo: 15,
				getChatroomMembersInfo: 16,
				kickChatroomMember: 17,
				updateChatroomMemberTempMute: 19,
				queueOffer: 20,
				queuePoll: 21,
				queueList: 22,
				peak: 23,
				queueDrop: 24,
				queueInit: 25,
				queueChange: 26,
				updateTagMembersTempMute: 30,
				getChatroomMembersByTag: 31,
				getChatroomMemberCountByTag: 32,
				updateCoordinate: 33,
				updateChatroomTags: 34,
				notifyCdnInfo: 99
			},
			user: {
				id: 3,
				syncRobot: 16
			}
		}),
		o = s.merge({}, r.cmdConfig, {
			login: {
				sid: i.chatroom.id,
				cid: i.chatroom.login,
				params: [{
					type: "byte",
					name: "type"
				}, {
					type: "Property",
					name: "login"
				}, {
					type: "Property",
					name: "imLogin"
				}]
			},
			logout: {
				sid: i.chatroom.id,
				cid: i.chatroom.logout
			},
			sendMsg: {
				sid: i.chatroom.id,
				cid: i.chatroom.sendMsg,
				params: [{
					type: "Property",
					name: "msg"
				}]
			},
			getChatroomMembers: {
				sid: i.chatroom.id,
				cid: i.chatroom.getChatroomMembers,
				params: [{
					type: "byte",
					name: "type"
				}, {
					type: "long",
					name: "time"
				}, {
					type: "int",
					name: "limit"
				}]
			},
			getHistoryMsgs: {
				sid: i.chatroom.id,
				cid: i.chatroom.getHistoryMsgs,
				params: [{
					type: "long",
					name: "timetag"
				}, {
					type: "int",
					name: "limit"
				}, {
					type: "bool",
					name: "reverse"
				}, {
					type: "LongArray",
					name: "msgTypes"
				}]
			},
			markChatroomMember: {
				sid: i.chatroom.id,
				cid: i.chatroom.markChatroomMember,
				params: [{
					type: "string",
					name: "account"
				}, {
					type: "int",
					name: "type"
				}, {
					type: "bool",
					name: "isAdd"
				}, {
					type: "int",
					name: "level"
				}, {
					type: "string",
					name: "custom"
				}]
			},
			closeChatroom: {
				sid: i.chatroom.id,
				cid: i.chatroom.closeChatroom,
				params: [{
					type: "string",
					name: "custom"
				}]
			},
			getChatroom: {
				sid: i.chatroom.id,
				cid: i.chatroom.getChatroom
			},
			updateChatroom: {
				sid: i.chatroom.id,
				cid: i.chatroom.updateChatroom,
				params: [{
					type: "Property",
					name: "chatroom"
				}, {
					type: "bool",
					name: "needNotify"
				}, {
					type: "String",
					name: "custom"
				}, {
					type: "Property",
					name: "antispamTag"
				}]
			},
			updateMyChatroomMemberInfo: {
				sid: i.chatroom.id,
				cid: i.chatroom.updateMyChatroomMemberInfo,
				params: [{
					type: "Property",
					name: "chatroomMember"
				}, {
					type: "bool",
					name: "needNotify"
				}, {
					type: "String",
					name: "custom"
				}, {
					type: "bool",
					name: "needSave"
				}, {
					type: "Property",
					name: "antispamTag"
				}]
			},
			getChatroomMembersInfo: {
				sid: i.chatroom.id,
				cid: i.chatroom.getChatroomMembersInfo,
				params: [{
					type: "StrArray",
					name: "accounts"
				}]
			},
			kickChatroomMember: {
				sid: i.chatroom.id,
				cid: i.chatroom.kickChatroomMember,
				params: [{
					type: "string",
					name: "account"
				}, {
					type: "string",
					name: "custom"
				}]
			},
			updateChatroomMemberTempMute: {
				sid: i.chatroom.id,
				cid: i.chatroom.updateChatroomMemberTempMute,
				params: [{
					type: "String",
					name: "account"
				}, {
					type: "long",
					name: "duration"
				}, {
					type: "bool",
					name: "needNotify"
				}, {
					type: "String",
					name: "custom"
				}]
			},
			queueOffer: {
				sid: i.chatroom.id,
				cid: i.chatroom.queueOffer,
				params: [{
					type: "string",
					name: "elementKey"
				}, {
					type: "string",
					name: "elementValue"
				}, {
					type: "bool",
					name: "transient"
				}, {
					type: "string",
					name: "elementAccount"
				}]
			},
			queuePoll: {
				sid: i.chatroom.id,
				cid: i.chatroom.queuePoll,
				params: [{
					type: "string",
					name: "elementKey"
				}]
			},
			queueList: {
				sid: i.chatroom.id,
				cid: i.chatroom.queueList
			},
			peak: {
				sid: i.chatroom.id,
				cid: i.chatroom.peak
			},
			queueDrop: {
				sid: i.chatroom.id,
				cid: i.chatroom.queueDrop
			},
			queueInit: {
				sid: i.chatroom.id,
				cid: i.chatroom.queueInit,
				params: [{
					type: "int",
					name: "limit"
				}]
			},
			queueChange: {
				sid: i.chatroom.id,
				cid: i.chatroom.queueChange,
				params: [{
					type: "StrStrMap",
					name: "elementMap"
				}, {
					type: "bool",
					name: "needNotify"
				}, {
					type: "string",
					name: "notifyExt"
				}]
			},
			updateTagMembersTempMute: {
				sid: i.chatroom.id,
				cid: i.chatroom.updateTagMembersTempMute,
				params: [{
					type: "Property",
					name: "tagMuteReq"
				}]
			},
			updateCoordinate: {
				sid: i.chatroom.id,
				cid: i.chatroom.updateCoordinate,
				params: [{
					type: "Property",
					name: "coordinateReq"
				}]
			},
			getChatroomMemberCountByTag: {
				sid: i.chatroom.id,
				cid: i.chatroom.getChatroomMemberCountByTag,
				params: [{
					type: "String",
					name: "tag"
				}]
			},
			getChatroomMembersByTag: {
				sid: i.chatroom.id,
				cid: i.chatroom.getChatroomMembersByTag,
				params: [{
					type: "Property",
					name: "tagMemberReq"
				}]
			},
			updateChatroomTags: {
				sid: i.chatroom.id,
				cid: i.chatroom.updateChatroomTags,
				params: [{
					type: "Property",
					name: "chatRoomTagsUpdateTag"
				}]
			},
			notifyCdnInfo: {
				sid: i.chatroom.id,
				cid: i.chatroom.notifyCdnInfo
			},
			syncRobot: {
				sid: i.user.id,
				cid: i.user.syncRobot,
				params: [{
					type: "long",
					name: "timetag"
				}]
			}
		}),
		a = s.merge({}, r.packetConfig, {
			"4_10": {
				service: "notify"
			},
			"4_11": {
				service: "notify"
			},
			"3_16": {
				service: "chatroom",
				cmd: "syncRobot",
				response: [{
					type: "PropertyArray",
					name: "robots",
					entity: "robot"
				}]
			},
			"13_2": {
				service: "chatroom",
				cmd: "login",
				response: [{
					type: "Property",
					name: "chatroom"
				}, {
					type: "Property",
					name: "chatroomMember"
				}, {
					type: "Property",
					name: "chatroomCdnInfo"
				}]
			},
			"13_3": {
				service: "chatroom",
				cmd: "kicked",
				response: [{
					type: "Number",
					name: "reason"
				}, {
					type: "String",
					name: "custom"
				}]
			},
			"13_4": {
				service: "chatroom",
				cmd: "logout"
			},
			"13_6": {
				service: "chatroom",
				cmd: "sendMsg",
				response: [{
					type: "Property",
					name: "msg"
				}]
			},
			"13_7": {
				service: "chatroom",
				cmd: "msg",
				response: [{
					type: "Property",
					name: "msg"
				}]
			},
			"13_8": {
				service: "chatroom",
				cmd: "getChatroomMembers",
				response: [{
					type: "PropertyArray",
					name: "members",
					entity: "chatroomMember"
				}]
			},
			"13_9": {
				service: "chatroom",
				cmd: "getHistoryMsgs",
				response: [{
					type: "PropertyArray",
					name: "msgs",
					entity: "msg"
				}]
			},
			"13_11": {
				service: "chatroom",
				cmd: "markChatroomMember",
				response: [{
					type: "Property",
					name: "chatroomMember"
				}]
			},
			"13_12": {
				service: "chatroom",
				cmd: "closeChatroom"
			},
			"13_13": {
				service: "chatroom",
				cmd: "getChatroom",
				response: [{
					type: "Property",
					name: "chatroom"
				}]
			},
			"13_14": {
				service: "chatroom",
				cmd: "updateChatroom"
			},
			"13_15": {
				service: "chatroom",
				cmd: "updateMyChatroomMemberInfo"
			},
			"13_16": {
				service: "chatroom",
				cmd: "getChatroomMembersInfo",
				response: [{
					type: "PropertyArray",
					name: "members",
					entity: "chatroomMember"
				}]
			},
			"13_17": {
				service: "chatroom",
				cmd: "kickChatroomMember"
			},
			"13_19": {
				service: "chatroom",
				cmd: "updateChatroomMemberTempMute"
			},
			"13_20": {
				service: "chatroom",
				cmd: "queueOffer"
			},
			"13_21": {
				service: "chatroom",
				cmd: "queuePoll",
				response: [{
					type: "String",
					name: "elementKey"
				}, {
					type: "String",
					name: "elementValue"
				}]
			},
			"13_22": {
				service: "chatroom",
				cmd: "queueList",
				response: [{
					type: "KVArray",
					name: "queueList"
				}]
			},
			"13_23": {
				service: "chatroom",
				cmd: "peak",
				response: [{
					type: "String",
					name: "elementKey"
				}, {
					type: "String",
					name: "elementValue"
				}]
			},
			"13_24": {
				service: "chatroom",
				cmd: "queueDrop"
			},
			"13_25": {
				service: "chatroom",
				cmd: "queueInit"
			},
			"13_26": {
				service: "chatroom",
				cmd: "queueChange",
				response: [{
					type: "StrArray",
					name: "elementKeyArray"
				}]
			},
			"13_30": {
				service: "chatroom",
				cmd: "updateTagMembersTempMute"
			},
			"13_33": {
				service: "chatroom",
				cmd: "updateCoordinate"
			},
			"13_31": {
				service: "chatroom",
				cmd: "getChatroomMembersByTag",
				response: [{
					type: "PropertyArray",
					name: "members",
					entity: "chatroomMember"
				}]
			},
			"13_32": {
				service: "chatroom",
				cmd: "getChatroomMemberCountByTag",
				response: [{
					type: "long",
					name: "count"
				}]
			},
			"13_34": {
				service: "chatroom",
				cmd: "updateChatroomTags"
			},
			"13_99": {
				service: "chatroom",
				cmd: "notifyCdnInfo",
				response: [{
					type: "Property",
					name: "chatroomCdnInfo"
				}]
			}
		});
	e.exports = {
		idMap: i,
		cmdConfig: o,
		packetConfig: a
	}
}, function(e, t) {
	e.exports = {
		imLogin: {
			clientType: 3,
			os: 4,
			sdkVersion: 6,
			appLogin: 8,
			protocolVersion: 9,
			pushTokenName: 10,
			pushToken: 11,
			deviceId: 13,
			appKey: 18,
			account: 19,
			browser: 24,
			session: 26,
			deviceInfo: 32,
			sdkType: 41,
			userAgent: 42,
			isReactNative: 112,
			authType: 115,
			loginExt: 116,
			token: 1e3,
			customTag: 38
		},
		nosToken: {
			objectName: 1,
			token: 2,
			bucket: 3,
			expireTime: 4,
			expireSec: 7,
			tag: 8,
			shortUrl: 9
		},
		audioToText: {
			url: 2
		},
		imageOp: {
			type: 0,
			stripmeta: 1,
			typeType: 2,
			blurRadius: 3,
			blurSigma: 4,
			qualityQuality: 5,
			cropX: 6,
			cropY: 7,
			cropWidth: 8,
			cropHeight: 9,
			rotateAngle: 10,
			pixelPixel: 11,
			thumbnailMode: 12,
			thumbnailWidth: 13,
			thumbnailHeight: 14,
			thumbnailAxisX: 15,
			thumbnailAxisY: 16,
			thumbnailCenterX: 17,
			thumbnailCenterY: 18,
			thumbnailEnlarge: 19,
			thumbnailToStatic: 20,
			watermarkType: 21,
			watermarkGravity: 22,
			watermarkDissolve: 23,
			watermarkDx: 24,
			watermarkDy: 25,
			watermarkImage: 26,
			watermarkText: 27,
			watermarkFont: 28,
			watermarkFontSize: 29,
			watermarkFontColor: 30,
			interlace: 31
		},
		robot: {
			account: 4,
			nick: 5,
			avatar: 6,
			intro: 7,
			config: 8,
			valid: 9,
			createTime: 10,
			updateTime: 11,
			custid: 12,
			botid: 13,
			bindTime: 14
		},
		clientAntispam: {
			version: 1,
			md5: 2,
			nosurl: 3,
			thesaurus: 4
		},
		fileQuickTransfer: {
			md5: 1,
			url: 2,
			size: 3,
			threshold: 4
		},
		transToken: {
			name: 1,
			type: 2,
			transType: 3,
			size: 4,
			extra: 5,
			body: 6
		},
		transInfo: {
			docId: 1,
			name: 2,
			prefix: 3,
			size: 4,
			type: 5,
			state: 6,
			transType: 7,
			transSize: 8,
			pageCount: 9,
			picInfo: 10,
			extra: 11,
			flag: 12
		},
		nosFileUrlTag: {
			safeUrl: 0,
			originUrl: 1
		},
		nosAccessTokenTag: {
			token: 0,
			url: 1,
			userAgent: 2,
			ext: 3
		},
		fileListParam: {
			fromDocId: 1,
			limit: 2
		},
		avSignalTag: {
			type: 1,
			channelName: 2,
			channelId: 3,
			channelCreateTime: 4,
			channelExpireTime: 5,
			creator: 6,
			ext: 7,
			channelInValid: 8,
			from: 10,
			to: 11,
			requestId: 12,
			needPush: 13,
			pushTitle: 14,
			pushContent: 15,
			pushPayload: 16,
			needBadge: 17,
			members: 18,
			attach: 19,
			attachExt: 20,
			isSave: 21,
			msgid: 22,
			uid: 23,
			time: 24
		},
		login: {
			appKey: 1,
			account: 2,
			deviceId: 3,
			chatroomId: 5,
			appLogin: 8,
			chatroomNick: 20,
			chatroomAvatar: 21,
			chatroomCustom: 22,
			chatroomEnterCustom: 23,
			session: 26,
			isAnonymous: 38,
			tags: 39,
			notifyTargetTags: 40,
			loginAuthType: 41,
			loginExt: 42,
			loc_x: 43,
			loc_y: 44,
			loc_z: 45,
			distance: 46,
			antiSpamBusinessId: 47
		},
		chatroom: {
			id: 1,
			name: 3,
			announcement: 4,
			broadcastUrl: 5,
			custom: 12,
			createTime: 14,
			updateTime: 15,
			queuelevel: 16,
			creator: 100,
			onlineMemberNum: 101,
			mute: 102
		},
		msg: {
			idClient: 1,
			type: 2,
			attach: 3,
			custom: 4,
			resend: 5,
			userUpdateTime: 6,
			fromNick: 7,
			fromAvatar: 8,
			fromCustom: 9,
			yidunEnable: 10,
			antiSpamContent: 11,
			skipHistory: 12,
			body: 13,
			antiSpamBusinessId: 14,
			clientAntiSpam: 15,
			antiSpamUsingYidun: 16,
			time: 20,
			from: 21,
			chatroomId: 22,
			fromClientType: 23,
			highPriority: 25,
			callbackExt: 27,
			subType: 28,
			yidunAntiCheating: 29,
			env: 30,
			notifyTargetTags: 31,
			yidunAntiSpamExt: 32,
			yidunAntiSpamRes: 33,
			loc_x: 34,
			loc_y: 35,
			loc_z: 36,
			toAccids: 37
		},
		chatroomMember: {
			chatroomId: 1,
			account: 2,
			type: 3,
			level: 4,
			nick: 5,
			avatar: 6,
			custom: 7,
			online: 8,
			guest: 9,
			enterTime: 10,
			blacked: 12,
			gaged: 13,
			valid: 14,
			updateTime: 15,
			tempMuted: 16,
			tempMuteDuration: 17
		},
		antispamTag: {
			antiSpamBusinessId: 1
		},
		chatroomCdnInfo: {
			enable: 1,
			cdnUrls: 2,
			timestamp: 3,
			interval: 4,
			decryptType: 5,
			decryptKey: 6,
			timeout: 7
		},
		tagMemberReq: {
			tag: 1,
			time: 2,
			limit: 3
		},
		tagMuteReq: {
			tag: 1,
			duration: 2,
			needNotify: 3,
			custom: 4,
			notifyTargetTags: 5
		},
		coordinateReq: {
			x: 1,
			y: 2,
			z: 3,
			distance: 4
		},
		chatRoomTagsUpdateTag: {
			tags: 1,
			notifyTargetTags: 2,
			needNotify: 3,
			ext: 4
		}
	}
}, function(e, t) {
	e.exports = {
		imLogin: {
			3: "clientType",
			4: "os",
			6: "sdkVersion",
			8: "appLogin",
			9: "protocolVersion",
			10: "pushTokenName",
			11: "pushToken",
			13: "deviceId",
			18: "appKey",
			19: "account",
			24: "browser",
			26: "session",
			32: "deviceInfo",
			38: "customTag",
			41: "sdkType",
			42: "userAgent",
			112: "isReactNative",
			1e3: "token"
		},
		nosToken: {
			1: "objectName",
			2: "token",
			3: "bucket",
			4: "expireTime",
			7: "expireSec",
			8: "tag",
			9: "shortUrl"
		},
		audioToText: {
			2: "url"
		},
		imageOp: {
			0: "type",
			1: "stripmeta",
			2: "typeType",
			3: "blurRadius",
			4: "blurSigma",
			5: "qualityQuality",
			6: "cropX",
			7: "cropY",
			8: "cropWidth",
			9: "cropHeight",
			10: "rotateAngle",
			11: "pixelPixel",
			12: "thumbnailMode",
			13: "thumbnailWidth",
			14: "thumbnailHeight",
			15: "thumbnailAxisX",
			16: "thumbnailAxisY",
			17: "thumbnailCenterX",
			18: "thumbnailCenterY",
			19: "thumbnailEnlarge",
			20: "thumbnailToStatic",
			21: "watermarkType",
			22: "watermarkGravity",
			23: "watermarkDissolve",
			24: "watermarkDx",
			25: "watermarkDy",
			26: "watermarkImage",
			27: "watermarkText",
			28: "watermarkFont",
			29: "watermarkFontSize",
			30: "watermarkFontColor",
			31: "interlace"
		},
		robot: {
			4: "account",
			5: "nick",
			6: "avatar",
			7: "intro",
			8: "config",
			9: "valid",
			10: "createTime",
			11: "updateTime",
			12: "custid",
			13: "botid",
			14: "bindTime",
			_6_safe: "_avatar_safe"
		},
		clientAntispam: {
			1: "version",
			2: "md5",
			3: "nosurl",
			4: "thesaurus"
		},
		fileQuickTransfer: {
			1: "md5",
			2: "url",
			3: "size",
			4: "threshold",
			_2_safe: "_url_safe"
		},
		transToken: {
			1: "name",
			2: "type",
			3: "transType",
			4: "size",
			5: "extra",
			6: "body"
		},
		transInfo: {
			1: "docId",
			2: "name",
			3: "prefix",
			4: "size",
			5: "type",
			6: "state",
			7: "transType",
			8: "transSize",
			9: "pageCount",
			10: "picInfo",
			11: "extra",
			12: "flag"
		},
		nosFileUrlTag: {
			0: "safeUrl",
			1: "originUrl"
		},
		nosAccessTokenTag: {
			0: "token",
			1: "url",
			2: "userAgent",
			3: "ext"
		},
		fileListParam: {
			1: "fromDocId",
			2: "limit"
		},
		avSignalTag: {
			1: "type",
			2: "channelName",
			3: "channelId",
			4: "channelCreateTime",
			5: "channelExpireTime",
			6: "creator",
			7: "ext",
			8: "channelInValid",
			10: "from",
			11: "to",
			12: "requestId",
			13: "needPush",
			14: "pushTitle",
			15: "pushContent",
			16: "pushPayload",
			17: "needBadge",
			18: "members",
			19: "attach",
			20: "attachExt",
			21: "isSave",
			22: "msgid",
			23: "uid",
			24: "time"
		},
		login: {
			1: "appKey",
			2: "account",
			3: "deviceId",
			5: "chatroomId",
			8: "appLogin",
			20: "chatroomNick",
			21: "chatroomAvatar",
			22: "chatroomCustom",
			23: "chatroomEnterCustom",
			26: "session",
			38: "isAnonymous",
			39: "tags",
			40: "notifyTargetTags",
			41: "loginAuthType",
			42: "loginExt",
			43: "loc_x",
			44: "loc_y",
			45: "loc_z",
			46: "distance",
			47: "antiSpamBusinessId",
			_21_safe: "_chatroomAvatar_safe"
		},
		chatroom: {
			1: "id",
			3: "name",
			4: "announcement",
			5: "broadcastUrl",
			12: "custom",
			14: "createTime",
			15: "updateTime",
			16: "queuelevel",
			100: "creator",
			101: "onlineMemberNum",
			102: "mute"
		},
		msg: {
			1: "idClient",
			2: "type",
			3: "attach",
			4: "custom",
			5: "resend",
			6: "userUpdateTime",
			7: "fromNick",
			8: "fromAvatar",
			9: "fromCustom",
			10: "yidunEnable",
			11: "antiSpamContent",
			12: "skipHistory",
			13: "body",
			14: "antiSpamBusinessId",
			15: "clientAntiSpam",
			16: "antiSpamUsingYidun",
			20: "time",
			21: "from",
			22: "chatroomId",
			23: "fromClientType",
			25: "highPriority",
			27: "callbackExt",
			28: "subType",
			29: "yidunAntiCheating",
			30: "env",
			31: "notifyTargetTags",
			32: "yidunAntiSpamExt",
			33: "yidunAntiSpamRes",
			34: "loc_x",
			35: "loc_y",
			36: "loc_z",
			37: "toAccids",
			_8_safe: "_fromAvatar_safe"
		},
		chatroomMember: {
			1: "chatroomId",
			2: "account",
			3: "type",
			4: "level",
			5: "nick",
			6: "avatar",
			7: "custom",
			8: "online",
			9: "guest",
			10: "enterTime",
			12: "blacked",
			13: "gaged",
			14: "valid",
			15: "updateTime",
			16: "tempMuted",
			17: "tempMuteDuration",
			_6_safe: "_avatar_safe"
		},
		antispamTag: {
			antiSpamBusinessId: 1
		},
		chatroomCdnInfo: {
			1: "enable",
			2: "cdnUrls",
			3: "timestamp",
			4: "interval",
			5: "decryptType",
			6: "decryptKey",
			7: "timeout"
		},
		nosConfigTag: {
			1: "bucket",
			2: "cdnDomain",
			3: "expire",
			4: "objectNamePrefix"
		}
	}
}, function(e, t, n) {
	var s = n(0),
		r = s.notundef,
		i = {
			addFriend: 1,
			applyFriend: 2,
			passFriendApply: 3,
			rejectFriendApply: 4
		},
		o = {
			1: "addFriend",
			2: "applyFriend",
			3: "passFriendApply",
			4: "rejectFriendApply"
		};

	function a(e) {
		s.verifyOptions(e, "account", "friend::Friend"), s.verifyParamAtLeastPresentOne(e, "alias custom",
			"friend::Friend"), this.account = e.account, r(e.alias) && (this.alias = e.alias), r(e
			.custom) && (this.custom = e.custom)
	}
	a.reverse = function(e) {
		var t = s.filterObj(e, "account alias custom createTime updateTime serverex");
		return r(e.flag) && (t.valid = "1" === e.flag), r(t.createTime) && (t.createTime = +t
			.createTime), r(t.updateTime) && (t.updateTime = +t.updateTime), t
	}, a.validTypes = function() {
		return Object.keys(i)
	}, a.getByteFromType = function(e) {
		return i[e]
	}, a.getTypeFromByte = function(e) {
		return o[e]
	}, a.assembleFriend = function(e) {
		var t = +new Date;
		return Object.assign({}, e, {
			alias: "",
			createTime: t,
			custom: "",
			updateTime: t,
			valid: !0
		})
	}, e.exports = a
}, function(e, t, n) {
	var s = n(0),
		r = s.notundef;

	function i(e, t) {
		Number.isInteger(e.body) || s.onParamError("body只能是整数", t), this.body = e.body, this.from = e
			.from || "", this.custom = e.custom || "", r(e.pushTitle) && (this.pushTitle = e.pushTitle), r(e
				.apnsText) && (this.apnsText = e.apnsText), r(e.pushPayload) && (this.pushPayload = e
				.pushPayload), r(e.needPush) && (this.needPush = !0 === e.needPush ? 1 : 0), r(e
			.needBadge) && (this.needBadge = !0 === e.needBadge ? 1 : 0)
	}
	i.reverse = function(e) {
		var t = Object.assign({}, e);
		return r(e.needBadge) && (t.needBadge = 1 == +e.needBadge), r(e.needPush) && (t.needPush = 1 ==
			+e.needPush), t.body = +e.body, t.time = +e.time, t
	}, e.exports = i
}, function(e, t, n) {
	var s = n(0);

	function r(e, t) {
		Number.isInteger(e.type) || s.onParamError("Collect.type只能是整数", t), s.notundef(e.uniqueId) && (this
				.uniqueId = e.uniqueId), this.type = e.type, this.data = e.data || "", this.custom = e
			.custom || ""
	}
	r.reverse = function(e) {
		var t = Object.assign({}, e);
		return t.type = +t.type, t.createTime = +t.createTime, t.updateTime = +t.updateTime, t
	}, e.exports = r
}, function(e, t, n) {
	"use strict";
	var s = n(97),
		r = n(98),
		i = n(99),
		o = n(100);

	function a(e, t, n) {
		var s = e;
		return r(t) ? (n = t, "string" == typeof e && (s = {
			uri: e
		})) : s = o(t, {
			uri: e
		}), s.callback = n, s
	}

	function c(e, t, n) {
		return m(t = a(e, t, n))
	}

	function m(e) {
		if (void 0 === e.callback) throw new Error("callback argument missing");
		var t = !1,
			n = function(n, s, r) {
				t || (t = !0, e.callback(n, s, r))
			};

		function s() {
			var e = void 0;
			if (e = u.response ? u.response : u.responseText || function(e) {
					try {
						if ("document" === e.responseType) return e.responseXML;
						var t = e.responseXML && "parsererror" === e.responseXML.documentElement.nodeName;
						if ("" === e.responseType && !t) return e.responseXML
					} catch (e) {}
					return null
				}(u), y) try {
				e = JSON.parse(e)
			} catch (e) {}
			return e
		}

		function r(e) {
			return clearTimeout(l), e instanceof Error || (e = new Error("" + (e ||
				"Unknown XMLHttpRequest Error"))), e.statusCode = 0, n(e, v)
		}

		function o() {
			if (!m) {
				var t;
				clearTimeout(l), t = e.useXDR && void 0 === u.status ? 200 : 1223 === u.status ? 204 : u
					.status;
				var r = v,
					o = null;
				return 0 !== t ? (r = {
						body: s(),
						statusCode: t,
						method: p,
						headers: {},
						url: d,
						rawRequest: u
					}, u.getAllResponseHeaders && (r.headers = i(u.getAllResponseHeaders()))) : o =
					new Error("Internal XMLHttpRequest Error"), n(o, r, r.body)
			}
		}
		var a, m, u = e.xhr || null;
		u || (u = e.cors || e.useXDR ? new c.XDomainRequest : new c.XMLHttpRequest);
		var l, d = u.url = e.uri || e.url,
			p = u.method = e.method || "GET",
			g = e.body || e.data,
			f = u.headers = e.headers || {},
			h = !!e.sync,
			y = !1,
			v = {
				body: void 0,
				headers: {},
				statusCode: 0,
				method: p,
				url: d,
				rawRequest: u
			};
		if ("json" in e && !1 !== e.json && (y = !0, f.accept || f.Accept || (f.Accept =
				"application/json"), "GET" !== p && "HEAD" !== p && (f["content-type"] || f[
					"Content-Type"] || (f["Content-Type"] = "application/json"), g = JSON.stringify(!0 === e
						.json ? g : e.json))), u.onreadystatechange = function() {
				4 === u.readyState && setTimeout(o, 0)
			}, u.onload = o, u.onerror = r, u.onprogress = function() {}, u.onabort = function() {
				m = !0
			}, u.ontimeout = r, u.open(p, d, !h, e.username, e.password), h || (u.withCredentials = !!e
				.withCredentials), !h && e.timeout > 0 && (l = setTimeout((function() {
				if (!m) {
					m = !0, u.abort("timeout");
					var e = new Error("XMLHttpRequest timeout");
					e.code = "ETIMEDOUT", r(e)
				}
			}), e.timeout)), u.setRequestHeader)
			for (a in f) f.hasOwnProperty(a) && u.setRequestHeader(a, f[a]);
		else if (e.headers && ! function(e) {
				for (var t in e)
					if (e.hasOwnProperty(t)) return !1;
				return !0
			}(e.headers)) throw new Error("Headers cannot be set on an XDomainRequest object");
		return "responseType" in e && (u.responseType = e.responseType), "beforeSend" in e && "function" ==
			typeof e.beforeSend && e.beforeSend(u), u.send(g || null), u
	}
	e.exports = c, e.exports.default = c, c.XMLHttpRequest = s.XMLHttpRequest || function() {}, c
		.XDomainRequest = "withCredentials" in new c.XMLHttpRequest ? c.XMLHttpRequest : s.XDomainRequest,
		function(e, t) {
			for (var n = 0; n < e.length; n++) t(e[n])
		}(["get", "put", "post", "patch", "head", "delete"], (function(e) {
			c["delete" === e ? "del" : e] = function(t, n, s) {
				return (n = a(t, n, s)).method = e.toUpperCase(), m(n)
			}
		}))
}, function(e, t, n) {
	(function(t) {
		var n;
		n = "undefined" != typeof window ? window : void 0 !== t ? t : "undefined" != typeof self ?
			self : {}, e.exports = n
	}).call(this, n(14))
}, function(e, t) {
	e.exports = function(e) {
		if (!e) return !1;
		var t = n.call(e);
		return "[object Function]" === t || "function" == typeof e && "[object RegExp]" !== t ||
			"undefined" != typeof window && (e === window.setTimeout || e === window.alert || e ===
				window.confirm || e === window.prompt)
	};
	var n = Object.prototype.toString
}, function(e, t) {
	var n = function(e) {
		return e.replace(/^\s+|\s+$/g, "")
	};
	e.exports = function(e) {
		if (!e) return {};
		for (var t, s = {}, r = n(e).split("\n"), i = 0; i < r.length; i++) {
			var o = r[i],
				a = o.indexOf(":"),
				c = n(o.slice(0, a)).toLowerCase(),
				m = n(o.slice(a + 1));
			void 0 === s[c] ? s[c] = m : (t = s[c], "[object Array]" === Object.prototype.toString.call(
				t) ? s[c].push(m) : s[c] = [s[c], m])
		}
		return s
	}
}, function(e, t) {
	e.exports = function() {
		for (var e = {}, t = 0; t < arguments.length; t++) {
			var s = arguments[t];
			for (var r in s) n.call(s, r) && (e[r] = s[r])
		}
		return e
	};
	var n = Object.prototype.hasOwnProperty
}, function(e, t) {
	var n = {
		set: function(e, t, s) {
			n[e] = t, s && (s.support = t)
		}
	};
	e.exports = n
}, function(e, t) {
	function n(e) {
		var t = this,
			n = e.url || null;
		t.level = {
				debug: 0,
				log: 1,
				info: 2,
				warn: 3,
				error: 4
			} [e.level] || 0, t.logCache = [], t.logNum = 1, t.timeInterval = 5e3, window.onerror =
			function(e, n, s, r, i) {
				t.error(i)
			}, setInterval((function() {
				t.logCache.length > 0 && n && t.postLogs(n, t.logCache)
			}), t.timeInterval)
	}
	n.prototype.debug = function() {
		this.level > 0 || (console.debug.apply(this, arguments), this.cacheLogs.apply(this, ["[degbug]"]
			.concat(arguments)))
	}, n.prototype.log = function() {
		this.level > 1 || (console.log.apply(this, arguments), this.cacheLogs.apply(this, ["[log]"]
			.concat(arguments)))
	}, n.prototype.info = function() {
		this.level > 2 || (console.info.apply(this, arguments), this.cacheLogs.apply(this, ["[info]"]
			.concat(arguments)))
	}, n.prototype.warn = function() {
		this.level > 3 || (console.warn.apply(this, arguments), this.cacheLogs.apply(this, ["[warn]"]
			.concat(arguments)))
	}, n.prototype.error = function() {
		this.level > 4 || (console.error.apply(this, arguments), this.cacheLogs.apply(this, ["[error]"]
			.concat(arguments)))
	}, n.prototype.cacheLogs = function(e, t) {
		for (var n = [], s = 0; s < t.length; s++) {
			var r = t[s];
			"object" == typeof r ? n.push(JSON.stringify(r)) : n.push(r)
		}
		var i = this.logNum++ + " " + e + " " + n.join("; ");
		this.logCache.push(i.replace("%c", ""))
	}, n.prototype.postLogs = function(e, t) {
		var n = this,
			s = new XMLHttpRequest;
		s.onreadystatechange = function() {
				4 === s.readyState && (200 === s.status ? (console.info("LoggerPlugin::日志上报完成"), n
					.logCache = [], n.timeInterval = 5e3) : n.timeInterval += 5e3)
			}, s.open("POST", e), s.setRequestHeader("Content-Type", "plain/text;charset=utf-8"), s
			.timeout = 360, s.send(t.join("\n"))
	}, e.exports = n
}, function(e, t, n) {
	const s = n(5);
	e.exports = function(e) {
		e.db && (s.db = e.db), e.rnfs && (s.rnfs = e.rnfs, s.rnfs.size || (s.rnfs.size = 1048576), s
			.rnfs.nimPromise = function() {
				var e = s.rnfs;
				let t = e.size / 2 - 256;
				var n = (r = 0, s.rnfs.DocumentDirectoryPath + "/nimlog_" + r + ".log");
				var r;
				return e.exists(n).then(t => t ? e.stat(n) : Promise.reject(0)).then(e => e && e
					.size > t ? Promise.reject(1) : Promise.reject(0)).catch(t => ("number" ==
					typeof t && (e.nimIndex = t), Promise.resolve()))
			}())
	}
}, , , , function(e, t, n) {
	n(49);
	var s = n(3);
	n(53)(s), e.exports = s
}, function(e, t) {
	function n(e) {
		this.concurrency = 0, this.pendingTasks = [], this.queue = Promise.resolve(), this.logger = e
			.logger, this.notifyError = e.notifyError, this.enable = !1, this.server = null, this.name =
			null
	}
	var s = n.prototype;
	s.reset = function(e) {
		this.enable = !1
	}, s.clear = s.destroy = s.close = s.remove = s.init = function(e) {
		return Promise.resolve()
	}, e.exports = n
}, function(e, t, n) {
	var s = n(8).fn;
	s.setKey = function(e, t) {
		return this.put("kv", {
			key: e,
			value: t
		})
	}, s.getKey = function(e) {
		return this.get("kv", e).then((function(e) {
			return e && e.value
		}))
	}, s.setDonnop = function(e) {
		return this.setKey("donnop", e)
	}, s.getDonnop = function() {
		return this.getKey("donnop")
	}
}, function(e, t, n) {
	var s = n(8).fn;
	s.getTimetags = function(e) {
		var t = {};
		return this.getAll("timetag", {
			filter: e,
			mapper: function(e) {
				return -1 !== e.name.indexOf("team-") ? t[e.name] = 0 : t[e.name] = e.value,
					e
			}
		}).then((function() {
			return t
		}))
	}, s.getTeamMemberTimetags = function() {
		return this.getTimetags((function(e) {
			return -1 !== e.name.indexOf("team-")
		}))
	}, s.getTimetag = function(e) {
		return this.getOne("timetag", null, e).then((function(e) {
			return (e = e || {
				value: 0
			}).value
		}))
	}, s.getTeamMemberTimetag = function(e) {
		return 0
	}, s.updateTimetag = function(e, t) {
		var n = this,
			s = {
				name: e,
				value: t
			};
		return this.put("timetag", s).catch(e => {
			n.notifyError && n.notifyError(e)
		})
	}, s.updateMyInfoTimetag = function(e) {
		return this.updateTimetag("myInfo", e)
	}, s.updateRelationTimetag = function(e) {
		return this.updateTimetag("relations", e)
	}, s.getRelationsTimetag = function() {
		return this.getTimetag("relations")
	}, s.updateFriendTimetag = function(e) {
		return this.updateTimetag("friends", e)
	}, s.getFriendsTimetag = function() {
		return this.getTimetag("friends")
	}, s.updateFriendUserTimetag = function(e) {
		return this.updateTimetag("friendUsers", e)
	}, s.updateTeamTimetag = function(e) {
		return this.updateTimetag("teams", e)
	}, s.getTeamsTimetag = function() {
		return this.getTimetag("teams")
	}, s.updateSuperTeamTimetag = function(e) {
		return this.updateTimetag("superTeams", e)
	}, s.getSuperTeamsTimetag = function() {
		return this.getTimetag("superTeams")
	}, s.updateTeamMemberTimetag = function(e, t) {
		return this.updateTimetag("team-" + e, t)
	}, s.getTeamMembersTimetag = function(e) {
		return this.getTimetag("team-" + e)
	}, s.updateSuperTeamMemberTimetag = function(e, t) {
		return this.updateTimetag("superTeam-" + e, t)
	}, s.getSuperTeamMembersTimetag = function(e) {
		return this.getTimetag("superTeam-" + e)
	}, s.updateMyTeamMembersTimetag = function(e) {
		return this.updateTimetag("myTeamMembers", e)
	}, s.getBroadcastMsgTimetag = function(e) {
		return this.getTimetag("broadcastMsg")
	}, s.updateBroadcastMsgTimetag = function(e) {
		return this.updateTimetag("broadcastMsg", parseInt(e))
	}, s.updateRoamingMsgTimetag = function(e) {
		return this.updateTimetag("roamingMsgs", e)
	}, s.updateSuperTeamRoamingMsgTimetag = function(e) {
		return this.updateTimetag("superTeamRoamingMsgs", e)
	}, s.updateMsgReceiptsTimetag = function(e) {
		return this.updateTimetag("msgReceipts", e)
	}, s.updateDonnopTimetag = function(e) {
		return this.updateTimetag("donnop", e)
	}, s.updateSessionAck = function(e) {
		return this.updateTimetag("sessionAck", e)
	}, s.updateDeleteMsgSelf = function(e) {
		return this.updateTimetag("deleteMsgSelf", e)
	}, s.updateSuperTeamSessionAck = function(e) {
		return this.updateTimetag("superTeamSessionAck", e)
	}, s.deleteTimetag = function(e) {
		return this.remove("timetag", e)
	}, s.deleteTeamMemberTimetag = function(e) {
		return this.deleteTimetag("team-" + e)
	}, s.deleteSuperTeamMemberTimetag = function(e) {
		return this.deleteTimetag("superTeam-" + e)
	}
}, function(e, t, n) {
	var s = n(8).fn,
		r = n(0);
	s.mergeRelations = function(e, t, n, s, r) {
		var i = this,
			o = i.updateAndDelete("blacklist", e, t),
			a = i.updateAndDelete("mutelist", n, s);
		return Promise.all([o, a]).then((function() {
			return i.logger.info("db::mergeRelations: timetag " + r), i
				.updateRelationTimetag(r), [e, t, n, s, r]
		}))
	}, s.getRelations = function() {
		var e = this.getAll("blacklist"),
			t = this.getAll("mutelist");
		return Promise.all([e, t])
	}, s.markInBlacklist = function(e) {
		if ((e = r.copy(e)).isAdd) {
			var t = e.record;
			return this.put("blacklist", t)
		}
		var n = e.account;
		return this.remove("blacklist", n)
	}, s.markInMutelist = function(e) {
		if ((e = r.copy(e)).isAdd) {
			var t = e.record;
			return this.put("mutelist", t)
		}
		var n = e.account;
		return this.remove("mutelist", n)
	}
}, function(e, t, n) {
	var s = n(8).fn,
		r = n(0);
	s.mergeFriends = function(e, t, n) {
		var s = this;
		return s.updateAndDelete("friend", e, t).then((function() {
			return s.logger.log("db::mergeFriends: updateAndDelete done", e && e.map(e => e
				.account).join(",")), n && s.updateFriendTimetag(n), [e, t, n]
		}))
	}, s.putFriend = function(e) {
		return this.put("friend", e)
	}, s.updateFriend = function(e) {
		var t = this,
			n = (e = r.copy(e)).account;
		return this.getOne("friend", null, n, {
			modifyObj: e
		}).then((function(e) {
			return e ? t.logger.log("db::updateFriend: " + n) : t.logger.warn(
				"db::updateFriend: no record " + n), e
		}))
	}, s.deleteFriend = function(e) {
		var t = this.remove("friend", e),
			n = this.deleteUser(e);
		return Promise.all([t, n])
	}, s.getFriends = function(e = {}) {
		return this.getAll("friend", {
			filter: function(t) {
				return void 0 !== e.updateTime ? t.valid && t.updateTime > e.updateTime : t
					.valid
			}
		})
	}, s.getFriend = function(e) {
		return this.getOne("friend", null, e)
	}, s.getUserFromBlackList = function(e) {
		return this.getOne("blacklist", null, e)
	}
}, function(e, t, n) {
	var s = n(8).fn,
		r = n(0),
		i = n(4),
		o = n(25),
		a = n(20);

	function c(e) {
		return e.valid && e.validToCurrentUser
	}

	function m(e) {
		return e && e.valid
	}

	function u(e) {
		return e && r.fillUndef(e, {
			mute: !1,
			custom: ""
		}), e
	}
	s.mergeTeams = function(e, t, n) {
		var s = this,
			r = s.put("team", e),
			i = s.leaveTeams(t, n);
		return Promise.all([r, i]).then((function() {
			return s.logger.log("db::mergeTeams:"), s.updateTeamTimetag(n), [e, t, n]
		}))
	}, s.putTeam = function(e) {
		if (e) return r.isArray(e) || (e = [e]), e.forEach(e => {
			e.validToCurrentUser = !0
		}), this.put("team", e)
	}, s.updateTeam = function(e) {
		var t = this,
			n = (e = r.copy(e)).teamId;
		return t.getOne("team", null, n, {
			modifyObj: e
		}).then((function(s) {
			if (s) t.logger.log("db::updateTeam: " + n);
			else if (t.logger.warn("db::updateTeam: no record " + n), e.validToCurrentUser)
				return t.putTeam(e);
			return s
		}))
	}, s.transferTeam = function(e, t, n) {
		var s = this,
			r = e.teamId,
			i = e.memberUpdateTime,
			o = {
				teamId: r,
				account: t,
				type: "normal",
				updateTime: i
			},
			a = {
				teamId: r,
				account: n,
				type: "owner",
				updateTime: i
			};
		return s.updateTeamMembers([o, a]).then((function() {
			return s.putTeam(e).then((function() {
				return s.logger.info(
					`db::transferTeam: ${e.teamId} ${t} -> ${n}`), [e, t, n]
			}))
		}))
	}, s.leaveTeam = function(e) {
		var t = this;
		return t.updateTeam({
			teamId: e,
			validToCurrentUser: !1
		}).then((function() {
			return t.removeAllTeamMembers(e)
		}))
	}, s.dismissTeam = function(e, t) {
		var n = this,
			s = {
				teamId: e,
				valid: !1,
				validToCurrentUser: !1,
				updateTime: t
			};
		return n.updateTeam(s).then((function() {
			return n.removeAllTeamMembers(e)
		}))
	}, s.leaveTeams = function(e, t) {
		var n, s = this,
			r = [];
		return e.forEach((function(e) {
			n = s.leaveTeam(e.teamId, t), r.push(n)
		})), Promise.all(r)
	}, s.getTeamsByTeamIds = function(e) {
		var t, n = this,
			s = [];
		return e.forEach((function(e) {
			t = n.getTeam(e), s.push(t)
		})), Promise.all(s)
	}, s.getTeam = function(e) {
		e = "" + e;
		var t = this;
		return t.getOne("team", null, e).then((function(e) {
			return e ? (t.updateTeamProperties([e]), e) : null
		}))
	}, s.getTeams = function() {
		var e = this;
		return e.getAll("team", {
			filter: c
		}).then((function(t) {
			return e.updateTeamProperties(t), t
		}))
	}, s.updateTeamProperties = function(e) {
		e.forEach((function(e) {
			e && o.fillProperties(e)
		}))
	}, s.mergeTeamMembers = function(e, t, n, s) {
		var r = this,
			i = r.putTeamMembers(t),
			o = r.updateTeamMembers(n);
		return Promise.all([i, o]).then((function() {
			return r.logger.log("db::mergeTeamMembers: " + e), r.updateTeamMemberTimetag(e,
				s)
		}))
	}, s.putTeamMembers = function(e) {
		return this.put("teamMember", e)
	}, s.getTeamMembersByAccount = function(e) {
		return this.getOnly("teamMember", "account", e, {
			filter: m,
			mapper: u
		}).then()
	}, s.getTeamMembers = function(e) {
		var t = this;
		e = "" + e;
		return t.getOnly("teamMember", "teamId", e, {
			filter: function(e) {
				return e.valid
			},
			mapper: u
		}).then((function(e) {
			return t.updateTeamMemberProperties(e).then((function() {
				return e
			}))
		}))
	}, s.updateTeamMemberProperties = function(e) {
		var t, n = this,
			s = [];
		return e.forEach((function(e) {
			a.fillProperties(e) && (t = n.updateTeamMember(e), s.push(t))
		})), Promise.all(s)
	}, s.getInvalidTeamMembers = function(e, t) {
		var n = this;
		e = "" + e;
		var s, r = [];
		return t.forEach((function(t) {
			s = n.getOne("teamMember", null, a.genId(e, t)).then((function(e) {
				return u(e)
			})), r.push(s)
		})), Promise.all(r)
	}, s.updateTeamMember = function(e) {
		var t = this,
			n = e.teamId,
			s = e.account,
			i = a.genId(n, s),
			o = r.filterObj(e, "nickInTeam muteTeam mute custom updateTime type valid");
		return this.getOne("teamMember", null, i, {
			modifyObj: o,
			mapper: u
		}).then((function(e) {
			return e ? t.logger.log(`db::updateTeamMember: ${n} ${s}`, r.pickAsString(o, [
				"muteTeam", "mute", "updateTime", "type", "valid"
			])) : t.logger.warn(`db::updateTeam: no record ${n} ${s}`), e
		}))
	}, s.updateTeamMembers = function(e) {
		var t = this;
		if (!e.length) return Promise.resolve();
		var n, s = [];
		return e.forEach((function(e) {
			n = t.updateTeamMember(e), s.push(n)
		})), Promise.all(s)
	}, s.updateTeamManagers = function(e, t, n, s) {
		var r = t.map((function(t) {
			return {
				teamId: e,
				account: t,
				type: n ? "manager" : "normal",
				updateTime: s
			}
		}));
		return this.updateTeamMembers(r)
	}, s.removeTeamMembersByAccounts = function(e, t) {
		var n = t.map((function(t) {
			return {
				teamId: e,
				account: t,
				valid: !1
			}
		}));
		return this.updateTeamMembers(n)
	}, s.removeAllTeamMembers = function(e) {
		var t = this;
		return t.getOnly("teamMember", "teamId", e, {
			modifyObj: {
				valid: !1
			}
		}).then((function() {
			return t.logger.warn("db::removeAllTeamMembers: " + e), t
				.deleteTeamMemberTimetag(e)
		}))
	}, s.deleteTeamMembers = function(e) {
		var t = this;
		return t.getOnly("teamMember", "teamId", e, {
			remove: !0
		}).then((function() {
			t.logger.warn("db::deleteTeamMembers: " + e), t.deleteTeamMemberTimetag(e)
		}))
	}, s.deleteTeam = function(e) {
		var t, n = this,
			s = [];
		return r.isArray(e) || (e = [e]), e.forEach((function(e) {
			e = "" + e, t = n.get("team", e).then((function(t) {
				if (t && c(t)) throw i.stillInTeamError({
					callFunc: "team::deleteTeam",
					team: t
				});
				var s = n.remove("team", e),
					r = n.deleteTeamMembers(e);
				return Promise.all([s, r])
			})), s.push(t)
		})), 1 === s.length ? s[0] : Promise.all(s)
	}
}, function(e, t, n) {
	var s = n(8).fn,
		r = n(0),
		i = n(4),
		o = n(50),
		a = n(29);

	function c(e) {
		return e.valid && e.validToCurrentUser
	}

	function m(e) {
		return e && r.fillUndef(e, {
			mute: !1,
			custom: ""
		}), e
	}
	s.mergeSuperTeams = function(e, t, n) {
		var s = this,
			r = s.put("superTeam", e),
			i = s.leaveTeams(t, n);
		return Promise.all([r, i]).then((function() {
			return s.logger.log("db::mergeSuperTeams:"), s.updateSuperTeamTimetag(n), [e, t,
				n
			]
		}))
	}, s.putSuperTeam = function(e) {
		if (e) return r.isArray(e) || (e = [e]), e.forEach(e => {
			e.validToCurrentUser = !0
		}), this.put("superTeam", e)
	}, s.updateSuperTeam = function(e) {
		var t = this,
			n = (e = r.copy(e)).teamId;
		return t.getOne("superTeam", null, n, {
			modifyObj: e
		}).then((function(s) {
			return s ? (t.logger.info("db::updateSuperTeam: " + n), s) : (t.logger.warn(
				"db::updateSuperTeam: no record " + n), t.putSuperTeam(e))
		}))
	}, s.leaveSuperTeam = function(e) {
		var t = this;
		return t.updateSuperTeam({
			teamId: e,
			validToCurrentUser: !1
		}).then((function() {
			return t.removeAllSuperTeamMembers(e)
		}))
	}, s.dismissSuperTeam = function(e, t) {
		var n = this,
			s = {
				teamId: e,
				valid: !1,
				validToCurrentUser: !1,
				updateTime: t
			};
		return n.updateSuperTeam(s).then((function() {
			return n.removeAllSuperTeamMembers(e)
		}))
	}, s.leaveSuperTeams = function(e, t) {
		var n, s = this,
			r = [];
		return e.forEach((function(e) {
			n = s.leaveSuperTeam(e.teamId, t), r.push(n)
		})), Promise.all(r)
	}, s.getSuperTeamsByTeamIds = function(e) {
		var t, n = this,
			s = [];
		return e.forEach((function(e) {
			t = n.getSuperTeam(e), s.push(t)
		})), Promise.all(s)
	}, s.getSuperTeam = function(e) {
		e = "" + e;
		var t = this;
		return t.getOne("superTeam", null, e).then((function(e) {
			return e ? (t.updateSuperTeamProperties([e]), e) : null
		}))
	}, s.getSuperTeams = function() {
		var e = this;
		return e.getAll("superTeam", {
			filter: c
		}).then((function(t) {
			return e.updateSuperTeamProperties(t), t
		}))
	}, s.updateSuperTeamProperties = function(e) {
		e.forEach((function(e) {
			e && o.fillProperties(e)
		}))
	}, s.mergeSuperTeamMembers = function(e, t, n, s) {
		var r = this,
			i = r.putSuperTeamMembers(t),
			o = r.updateSuperTeamMembers(n);
		return Promise.all([i, o]).then((function() {
			return r.logger.log("db::mergeSuperTeamMembers: " + e), null != s ? r
				.updateSuperTeamMemberTimetag(e, s) : Promise.resolve()
		}))
	}, s.putSuperTeamMembers = function(e) {
		return this.put("superTeamMember", e)
	}, s.getSuperTeamMemberById = function(e) {
		return this.get("superTeamMember", e)
	}, s.getSuperTeamMembers = function(e, t) {
		var n = this;
		e = "" + e;
		var s = {
			filter: e => e.valid,
			mapper: m
		};
		if (t) {
			if ("number" != typeof t.joinTime) return void n.logger.error(
				"db::getSuperTeamMembers::params.joinTime should be number, not ", t.joinTime);
			t.limit && (s.limit = t.limit), t.reverse ? s.filter = e => e.valid && e.joinTime <= t
				.joinTime : s.filter = e => e.valid && e.joinTime >= t.joinTime
		}
		return n.getOnly("superTeamMember", "teamId", e, s).then((function(e) {
			return n.updateSuperTeamMemberProperties(e).then((function() {
				return e
			}))
		}))
	}, s.updateSuperTeamMemberProperties = function(e) {
		var t, n = this,
			s = [];
		return e.forEach((function(e) {
			a.fillProperties(e) && (t = n.updateSuperTeamMember(e), s.push(t))
		})), Promise.all(s)
	}, s.getInvalidSuperTeamMembers = function(e, t) {
		var n = this;
		e = "" + e;
		var s, r = [];
		return t.forEach((function(t) {
			s = n.getOne("superTeamMember", "id", a.genId(e, t)).then((function(e) {
				return m(e)
			})), r.push(s)
		})), Promise.all(r)
	}, s.updateSuperTeamMember = function(e) {
		var t = this,
			n = e.teamId,
			s = e.account,
			i = a.genId(n, s),
			o = r.filterObj(e, "nickInTeam muteTeam mute custom updateTime type valid");
		return this.getOne("superTeamMember", "id", i, {
			modifyObj: o,
			mapper: m
		}).then((function(e) {
			return e ? t.logger.log(`db::updateSuperTeamMember: ${n} ${s}`, r.pickAsString(
					o, ["muteTeam", "mute", "updateTime", "type", "valid"])) : t.logger
				.warn(`db::updateSuperTeam: no record ${n} ${s}`), e
		}))
	}, s.updateSuperTeamMembers = function(e) {
		var t = this;
		if (!e.length) return Promise.resolve();
		var n, s = [];
		return e.forEach((function(e) {
			n = t.updateSuperTeamMember(e), s.push(n)
		})), Promise.all(s)
	}, s.removeSuperTeamMembersByAccounts = function(e, t) {
		var n = t.map((function(t) {
			return {
				teamId: e,
				account: t,
				valid: !1
			}
		}));
		return this.updateSuperTeamMembers(n)
	}, s.removeAllSuperTeamMembers = function(e) {
		var t = this;
		return t.getOnly("superTeamMember", "teamId", e, {
			modifyObj: {
				valid: !1
			}
		}).then((function() {
			return t.logger.warn("db::removeAllSuperTeamMembers: " + e), t
				.deleteSuperTeamMemberTimetag(e)
		}))
	}, s.deleteSuperTeamMembers = function(e) {
		var t = this;
		return t.getOnly("superTeamMember", "teamId", e, {
			remove: !0
		}).then((function() {
			t.logger.warn("db::deleteSuperTeamMembers: " + e), t
				.deleteSuperTeamMemberTimetag(e)
		}))
	}, s.deleteSuperTeam = function(e) {
		var t, n = this,
			s = [];
		return r.isArray(e) || (e = [e]), e.forEach((function(e) {
			e = "" + e, t = n.get("superTeam", e).then((function(t) {
				if (t && c(t)) throw i.stillInTeamError({
					callFunc: "team::deleteTeam",
					team: t
				});
				var s = n.remove("superTeam", e),
					r = n.deleteSuperTeamMembers(e);
				return Promise.all([s, r])
			})), s.push(t)
		})), 1 === s.length ? s[0] : Promise.all(s)
	}, s.transferSuperTeam = function(e, t, n) {
		var s = this;
		return s.updateSuperTeamMembers([t, n]).then((function() {
			return s.putSuperTeam(e).then((function() {
				return s.logger.info(
					`db::transferSuperTeam: ${e.teamId} ${t.account} -> ${n.account}`
					), [e, t, n]
			}))
		}))
	}
}, function(e, t, n) {
	var s = n(8).fn,
		r = n(0);
	s.mergeMyInfo = function(e, t) {
		var n = this;
		return n.put("user", e).then((function() {
			return t ? n.updateMyInfoTimetag(e.updateTime) : e
		}))
	}, s.mergeFriendUsers = function(e, t) {
		var n = this;
		return n.putUsers(e).then((function() {
			n.updateFriendUserTimetag(t)
		}))
	}, s.putUsers = function(e) {
		return this.put("user", e)
	}, s.putUser = function(e) {
		return this.put("user", e)
	}, s.updateUser = function(e) {
		var t = this,
			n = (e = r.copy(e)).account;
		return this.getOne("user", null, n, {
			modifyObj: e
		}).then((function(e) {
			return e ? t.logger.log("db::updateUser: " + n) : t.logger.warn(
				"db::updateUser: no record " + n), e
		}))
	}, s.putUsersIfIsFriend = function(e) {
		var t, n = this,
			s = [],
			r = [];
		return e.forEach((function(e) {
			t = n.getFriend(e.account).then((function(s) {
				return s && (t = n.putUser(e), r.push(t)), s
			})), s.push(t)
		})), Promise.all(s).then((function() {
			return Promise.all(r).then((function(e) {
				return e
			}))
		}))
	}, s.deleteUser = function(e) {
		return this.remove("user", e)
	}, s.getUser = function(e) {
		return this.getOne("user", null, e)
	}, s.getUsers = function(e) {
		return this.getAll("user", {
			filter: function(t) {
				return -1 !== e.indexOf(t.account)
			}
		})
	}, s.getAllUsers = function() {
		return this.getAll("user")
	}
}, function(e, t, n) {
	var s = n(8).fn,
		r = n(0);
	const i = n(1);
	s.putMsg = function(e) {
		var t = this;
		return r.isArray(e) || (e = [e]), !e.length || e[0].filter ? Promise.resolve() : (e = e.filter(
			e => !e.ignore), t.put("msg1", e).catch(n => (t.notifyError && t.notifyError(n),
			Promise.resolve(e, n))))
	}, s.putMsgReadDetail = function(e) {
		if (e.idClient) return this.put("msgReadDetail", e).catch(e => {
			this.logger.error("putMsgReadDetail error", e)
		})
	}, s.getMsgReadDetail = function(e) {
		return this.getOne("msgReadDetail", null, e)
	}, s.updateMsg = function(e) {
		var t = this;
		if (!e.filter) {
			var n = e.idClient,
				s = r.filterObj(e,
					"resend status idServer time localCustom commentTimetag comments hasSendAck");
			return t.getOne("msg1", null, n, {
				modifyObj: s
			}).then((function(e) {
				return e ? t.logger.info(
					`db::updateMsg: ${n}，idServer: ${s.idServer}，status: ${s.status}，time: ${s.time}`
					) : t.logger.warn("db::updateMsg: no record " + n), e
			})).catch(n => (t.notifyError && t.notifyError(n), Promise.resolve(e)))
		}
	}, s.updateMsgBatch = function(e) {
		if (i.isRN) return void this.logger.warn("react native can not support updateMsgBatch");
		this.checkDB();
		const t = this.server.getIndexedDB().transaction(["msg1"], "readwrite").objectStore("msg1");
		e.forEach(e => {
			if (!e.idClient) return;
			const n = t.get(e.idClient);
			n.onerror = e => {
				this.logger.error("updateMsgBatch::store.get:error", e)
			}, n.onsuccess = s => {
				var r = n.result || e;
				t.put(Object.assign({}, r, e)).onerror = e => {
					this.logger.error("updateMsgBatch::store.put:error", e)
				}
			}
		})
	}, s.getMsgs = function(e) {
		return i.isBrowser ? this.getMsgsIndexedDB(e) : i.isRN ? this.getMsgsRN(e) : Promise.resolve()
	}, s.getMsgsRN = function(e) {
		const t = {};
		return "number" == typeof e.start && (t.lowerBound = ["time", e.start]), "number" == typeof e
			.end && e.end !== 1 / 0 && (t.upperBound = ["time", e.end]), t.desc = !1, t.index = "time",
			"boolean" == typeof e.desc && (t.desc = e.desc), "number" == typeof e.limit && (t.limit = e
				.limit), t.searchIndex = [], e.sessionId && t.searchIndex.push(["sessionId", e
				.sessionId]), "string" == typeof e.type && t.searchIndex.push(["type", e.type]), this
			.getAll("msg1", t)
	}, s.getMsgsIndexedDB = function(e) {
		this.checkDB();
		let t = "time",
			n = !1,
			s = !1,
			i = (e = e || {}).sessionId || [],
			o = e.sessionIds || [];
		r.isString(i) ? i = [i] : Array.isArray(i) || (i = []), r.isString(o) ? o = [o] : Array.isArray(
			o) || (o = []);
		let a = i.concat(o);
		1 === a.length ? (n = !0, t = "sessionTime", i = a[0]) : a.length > 1 && (n = !0, s = !0, o =
		a);
		const c = e.start || 0,
			m = e.end || 1 / 0;
		let u = c,
			l = m;
		n && !s && (u = [i, c], l = [i, m]);
		const d = !1 !== e.desc,
			p = e.limit || 100;
		let g = !1,
			f = !1,
			h = e.type || [],
			y = e.types || [];
		r.isString(h) ? h = [h] : Array.isArray(h) || (h = []), r.isString(y) ? y = [y] : Array.isArray(
			y) || (y = []);
		let v = h.concat(y);
		1 === v.length ? (g = !0, h = v[0]) : v.length > 1 && (g = !0, f = !0, y = v);
		const b = e.subTypes && e.subTypes.length,
			T = e.keyword || "",
			S = e.filterFunc;
		let M;
		return (s || g || T || b || r.isFunction(S)) && (M = function(t) {
			if (s && -1 === o.indexOf(t.sessionId)) return !1;
			if (g)
				if (f) {
					if (-1 === y.indexOf(t.type)) return !1
				} else if (h !== t.type) return !1;
			if (b && -1 === e.subTypes.indexOf(t.subType)) return !1;
			if (T) {
				if (-1 === (t.text || t.tip || "").indexOf(T)) return !1
			}
			return !S || S(t)
		}), this.server.query("msg1", t).bound(u, l, !0, !0).desc(d).limit(p).filter(M).execute()
	}, s.getMsgCountAfterAck = function(e) {
		return i.isBrowser ? this.getMsgCountAfterAckIndexedDB(e) : i.isRN ? this.getMsgCountAfterAckRN(
			e) : Promise.resolve()
	}, s.getMsgCountAfterAckRN = function(e) {
		const t = this;
		e = e || {};
		const {
			sessionId: n,
			ack: s
		} = e;
		return t.checkDB(), t.getAll("msg1", {
			searchIndex: ["sessionId", n],
			lowerBound: ["time", s]
		}).then(n => {
			let s = n.filter(n => {
				if ("out" === n.flow || !1 === n.isUnreadable) return !1;
				if ("notification" === n.type) try {
					return e.shouldCountNotifyUnread(n)
				} catch (e) {
					throw t.logger.error(
							"userOption:shouldCountNotifyUnread function error", e),
						e
				}
				return !0
			});
			return Promise.resolve(s.length)
		})
	}, s.getMsgCountAfterAckIndexedDB = function(e) {
		const t = this;
		e = e || {};
		const {
			sessionId: n
		} = e;
		return t.checkDB(), t.server.query("msg1", "sessionTime").bound([n, e.ack], [n, 1 / 0], !0, !0)
			.execute().then(n => {
				let s = n.filter(n => {
					if ("out" === n.flow || !1 === n.isUnreadable) return !1;
					if ("notification" === n.type) try {
						return e.shouldCountNotifyUnread(n)
					} catch (e) {
						throw t.logger.error(
								"userOption:shouldCountNotifyUnread function error", e),
							e
					}
					return !0
				});
				return Promise.resolve(s.length)
			})
	}, s.amendMsg = function(e) {
		return e ? (r.notexist(e.text) && (e.text = ""), e) : null
	}, s.getMsgByIdClient = function(e) {
		var t = this;
		return t.getOne("msg1", null, e).then((function(e) {
			return t.amendMsg(e)
		}))
	}, s.getMsgsByIdClients = function(e) {
		var t, n = this,
			s = [];
		return e.forEach((function(e) {
			t = n.getMsgByIdClient(e), s.push(t)
		})), Promise.all(s)
	}, s.clearSendingMsgs = function() {
		var e = this;
		return e.getOnly("msg1", "status", "sending", {
			modifyObj: {
				status: "fail"
			}
		}).then((function(t) {
			e.logger.info("db::clearSendingMsgs: msgs send failed", t && t.map(e => e
				.idClient).join(","))
		}))
	}, s.deleteMsg = function(e) {
		var t, n = this,
			s = [];
		return r.isArray(e) || (e = [e]), e.forEach((function(e) {
			t = n.getOne("msg1", null, e, {
				remove: !0
			}).then((function(e) {
				return n.logger.info("db::deleteMsg:", e && e.idClient), e
			})), s.push(t)
		})), 1 === s.length ? s[0] : Promise.all(s)
	}, s.deleteMsgsBySessionId = function(e) {
		var t = this,
			n = null,
			s = e.start,
			r = e.end;
		return void 0 !== s && void 0 !== r ? n = e => e > s && e < r : void 0 !== s ? n = e => e > s :
			void 0 !== r && (n = e => e < r), n ? t.getOnly("msg1", "sessionId", e.sessionId).then((
				function(e) {
					var s = [];
					return (e = e || []).map(e => {
							n(e.time) && s.push(e.idClient)
						}), t.logger.info("db::deleteMsgsBySessionId: session results", s), t
						.deleteMsg(s)
				})) : t.getOnly("msg1", "sessionId", e.sessionId, {
				remove: !0
			})
	}, s.deleteMsgsByTime = function(e) {
		return this.remove("msg1", null, "time", e.start, e.end, !0, !0)
	}, s.deleteAllMsgs = function() {
		var e = this.clearTable("msg1"),
			t = this.clearTable("session");
		return Promise.all([e, t])
	}, s.getMsgPins = function(e) {
		return this.getOnly("msgPin", "sessionId", e)
	}, s.deleteMsgPins = function(e) {
		return this.getOnly("msgPin", "sessionId", e, {
			remove: !0
		})
	}, s.putMsgPin = function(e) {
		return this.modifyOrPut({
			table: "msgPin",
			obj: e,
			key: "idClient"
		}).catch(e => {
			this.notifyError && this.notifyError(e)
		})
	}, s.putMsgPins = function(e) {
		return this.put("msgPin", e)
	}, s.deleteMsgPin = function(e) {
		return this.getOne("msgPin", null, e.idClient, {
			remove: !0
		}).then(e => (this.logger.info("db::deleteMsgPin:", e.idClient), e))
	}
}, function(e, t, n) {
	var s = n(8).fn,
		r = n(0),
		i = r.notundef;
	s.putSysMsg = function(e) {
		var t = this;
		return new Promise((function(n) {
			if (r.isArray(e) || (e = [e]), !e[0].filter) {
				var s = [],
					i = e.length;
				e.forEach((function(e) {
					e = r.copy(e), t.put("sysMsg", e).then((function(e) {
						s.push(e[0]), o()
					}), o)
				}))
			}

			function o() {
				0 === --i && n(s)
			}
		}))
	}, s.getSysMsgs = function(e) {
		var t = !(e = e || {}).reverse,
			n = e.limit || 100,
			s = null,
			r = null;
		e.category && (s = "category", r = e.category), e.type && (s = "type", r = e.type);
		var o, a = e.lastIdServer,
			c = !1,
			m = e.read;
		return (i(a) || i(m)) && (o = function(e) {
			return i(a) ? (a = "" + a, c ? t() : (e.idServer === a && (c = !0), !1)) : t();

			function t() {
				return !i(m) || e.read === m
			}
		}), e = {
			filter: o,
			desc: t,
			limit: n
		}, s ? this.getOnly("sysMsg", s, r, e) : this.getAll("sysMsg", e)
	}, s.getSysMsgByIdServer = function(e) {
		return this.getOne("sysMsg", "idServer", e)
	}, s.updateSysMsg = function(e) {
		var t = this;
		if (!e.filter) {
			var n = "" + e.idServer,
				s = r.filterObj(e, "read state error localCustom");
			return this.getOne("sysMsg", "idServer", n, {
				modifyObj: s
			}).then((function(e) {
				return e ? t.logger.log("db::updateSysMsg: " + n, r.pickAsString(s, ["read",
					"state", "error"
				])) : t.logger.warn("db::updateSession: " + n), e
			}))
		}
	}, s.markSysMsgRead = function(e) {
		var t = this;
		return new Promise((function(n, s) {
			r.isArray(e) || (e = [e]);
			var i, o, a = [],
				c = [];
			e.forEach((function(e) {
				i = t.getSysMsgByIdServer(e.idServer).then((function(e) {
					e && !e.read && (o = t.updateSysMsg({
						idServer: e.idServer,
						read: !0
					}), c.push(o))
				}), s), a.push(i)
			})), Promise.all(a).then((function() {
				Promise.all(c).then((function(e) {
					n(e)
				}), s)
			}), s)
		}))
	}, s.deleteSysMsg = function(e) {
		var t, n = this,
			s = [];
		return r.isArray(e) || (e = [e]), e.forEach((function(e) {
			e = "" + e, t = n.getOne("sysMsg", "idServer", e, {
				remove: !0
			}), s.push(t)
		})), 1 === s.length ? s[0] : Promise.all(s)
	}, s.deleteAllSysMsgs = function() {
		var e = this.clearTable("sysMsg"),
			t = this.clearTable("sysMsgUnread");
		return Promise.all([e, t])
	}, s.getSysMsgUnread = function() {
		return this.getAll("sysMsgUnread").then((function(e) {
			var t = {};
			return e.forEach((function(e) {
				t[e.type] = e.num
			})), t
		}))
	}, s.updateSysMsgUnread = function(e) {
		var t = this;
		e = r.copy(e);
		var n = [];
		return Object.keys(e).forEach((function(t) {
			n.push({
				type: t,
				num: e[t]
			})
		})), this.put("sysMsgUnread", n).then((function() {
			return t.logger.info("db::updateSysMsgUnread: ", e), e
		}))
	}
}, function(e, t, n) {
	var s = n(8).fn,
		r = n(0);
	r.notundef;
	s.putBroadcastMsg = function(e) {
		var t = this;
		return new Promise((function(n) {
			r.isArray(e) || (e = [e]);
			var s = [],
				i = e.length;

			function o() {
				0 === --i && n(s)
			}
			e.forEach((function(e) {
				e = r.copy(e), t.put("broadcastMsg", e).then((function(e) {
					s.push(e[0]), o()
				}), o)
			}))
		}))
	}, s.getBroadcastMsgs = function(e) {
		return e = e || {}, this.getAll("broadcastMsg", e)
	}
}, function(e, t, n) {
	var s = n(8).fn,
		r = n(0),
		i = r.notundef;
	s.putSession = function(e) {
		var t = this,
			n = e.unread;
		return void 0 === (e = r.merge({}, e)).updateTime && e.lastMsg && e.lastMsg.time && (e
			.updateTime = e.lastMsg.time), (e.lastMsg || !e.ack && !e.msgReceiptTime) && (e
			.isDeleted = !1), delete e.unread, this.modifyOrPut({
			table: "session",
			obj: e,
			key: "id",
			modifyObjWhenPut: {
				unread: 0
			}
		}).catch(s => (t.notifyError && t.notifyError(s), e.unread = n, Promise.resolve(e)))
	}, s.getAllSessions = function() {
		return this.getAll("session", {
			index: "updateTime",
			desc: !0
		}).catch(e => {
			self.notifyError && self.notifyError(e)
		})
	}, s.getSessions = function(e) {
		var t = !(e = e || {}).reverse,
			n = e.limit || 100,
			s = e.lastSessionId,
			r = e.sessionId,
			o = !1,
			a = this,
			c = () => !0,
			m = () => !0;
		return i(r) ? this.getSession(r, e.isDeleted) : (i(s) && (c = function(e) {
			return e.id === s && (o = !0), o
		}), e.includeDeleted || (m = e => !e.isDeleted), this.getAll("session", {
			index: "updateTime",
			desc: t,
			limit: n,
			filter: e => c(e) && m(e)
		}).catch(e => {
			a.notifyError && a.notifyError(e)
		}))
	}, s.getSession = function(e, t) {
		var n = this;
		return this.get("session", e).then(e => Promise.resolve(!t && e && e.isDeleted ? void 0 : e))
			.catch(e => {
				n.notifyError && n.notifyError(e)
			})
	}, s.updateSession = function(e) {
		var t = this,
			n = e.id,
			s = r.filterObj(e,
				"ack unread lastMsg localCustom msgReceiptTime msgReceiptServerTime isTop topCustom isDeleted"
				);
		return e.lastMsg && (s.lastMsg = e.lastMsg), this.getOne("session", null, n, {
			modifyObj: s
		}).then((function(e) {
			if (e) {
				let e =
					`db::updateSession: ${n} ${r.pickAsString(s,["ack","unread","msgReceiptTime","msgReceiptServerTime","isTop","isDeleted"])}`;
				e += s.lastMsg ? " lastMsg.idClient:" + r.get(s, "lastMsg.idClient") : "", t
					.logger.info(e)
			} else t.logger.warn("db::updateSession: no record " + n);
			return e
		})).catch(e => {
			t.notifyError && t.notifyError(e)
		})
	}, s.getStickTopSessions = function() {
		return this.getAll("session", {
			filter: e => e && e.isTop
		}).catch(e => {
			this.notifyError && this.notifyError(e)
		})
	}, s.deleteSession = function(e) {
		return this.remove("session", e)
	}, s.deleteSessionLogic = function(e) {
		if (!Array.isArray(e)) return this.getOne("session", null, e, {
			modifyObj: {
				isDeleted: !0
			}
		});
		var t = [];
		return e.forEach(e => {
			t.push(this.getOne("session", null, e, {
				modifyObj: {
					isDeleted: !0
				}
			}))
		}), Promise.all(t)
	}, s.putSessionsWithMoreRoaming = function(e) {
		return this.put("sessionsWithMoreRoaming", e)
	}, s.updateSessionsWithMoreRoaming = function(e) {
		var t = e.id;
		return delete e.id, this.getOne("sessionsWithMoreRoaming", null, t, {
			modifyObj: e
		})
	}, s.deleteSessionsWithMoreRoaming = function(e) {
		return this.remove("sessionsWithMoreRoaming", e)
	}, s.getSessionsWithMoreRoaming = function(e) {
		return e ? this.get("sessionsWithMoreRoaming", e) : this.getAll("sessionsWithMoreRoaming")
	}
}, function(e, t, n) {
	const {
		throttle: s
	} = n(0);
	e.exports = class {
		constructor(e) {
			this.arr = [], this.timer = null, this.maxLength = e.maxLength || 100, this
				.throttleTime = e.throttleTime || 5e3, this.processFn = e.processFn ||
			function() {}, this.throttleFn = e.processFn || function() {}, e.processFn && (this
					.throttleFn = s((function(t) {
						e.processFn(t), t.length = 0
					}), this.throttleTime, {
						leading: !1
					}))
		}
		add(e) {
			"[object Array]" === Object.prototype.toString.call(e) ? this.arr = this.arr.concat(e) :
				this.arr.push(e), this.arr.length >= this.maxLength && (this.processFn(this.arr),
					this.arr = []), this.timer = this.throttleFn(this.arr)
		}
		destroy() {
			this.arr = [], this.timer && clearTimeout(this.timer), this.processFn = function() {},
				this.throttleFn = function() {}
		}
		clear() {
			this.arr = [], this.timer && clearTimeout(this.timer)
		}
	}
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(1),
		i = n(9),
		o = n(0),
		a = n(10);

	function c(e, t) {
		var n = this;
		n.socketUrls = [], i.updateUniSuccCache("login", {
			operation_type: "HTTP",
			target: t
		}), n.msgStatEnable = !!e.common["msg.stat.enable"], n.msgStatEnable && (n.msgDelayTimer =
			setTimeout(n.doReportMsgDelay.bind(n), 1e4)), e.common.link.forEach((function(e) {
			n.socketUrls.push(r.formatSocketUrl({
				url: e,
				secure: n.options.secure
			}))
		})), e.common["link.default"].forEach((function(e) {
			e = r.formatSocketUrl({
				url: e,
				secure: n.options.secure
			}), -1 === n.socketUrls.indexOf(e) && n.socketUrls.push(e)
		}));
		try {
			r.uploadUrl = e.nosup[0]
		} catch (e) {}
		if (r.chunkUploadUrl = r.chunkUploadUrl || e["nos-chunk"] || "", n.logger.info(
				`link::refreshSocketUrl: ${t.slice(0,-32)} ajax load , got socket urls `, n.socketUrls), n
			.connectToUrl(n.getNextSocketUrl()), r.hasLocalStorage) {
			e.common["lbs.backup"] && n.options.lbsBackup && localStorage.setItem("nim_lbs_backup", JSON
				.stringify(e.common["lbs.backup"]));
			var s = o.get(e, "common.report.apierror.on");
			e.common.report && localStorage.setItem("nim_lbs_fail_report_on", !1 === s ? "0" : "1");
			var a = o.get(e, "common.report.apierror.threshold.time");
			a && localStorage.setItem("nim_lbs_fail_report_time", a)
		}
	}
	s.probeIp = function() {
		let e = this;
		const t = r.ipProbeAddr;
		let n = 0,
			s = -1;

		function i(t) {
			n++, 2 === n && (n = -1, e.doRefreshSocketUrl(s))
		}
		a(t.ipv4, {
			timeout: 2e3,
			onerror: i,
			onload: e => {
				s++, i()
			}
		}), a(t.ipv6, {
			timeout: 2e3,
			onerror: i,
			onload: e => {
				s += 2, i()
			}
		}), setTimeout((function() {
			n || -1 === s || (n = -1, e.doRefreshSocketUrl(s))
		}), 100)
	}, s.refreshSocketUrl = function() {
		r.isWeixinApp ? this.doRefreshSocketUrl(2) : 2 === this.options.ipVersion ? this.probeIp() :
			this.doRefreshSocketUrl(this.options.ipVersion)
	}, s.doRefreshSocketUrl = function(e) {
		var t = this,
			n = t.options.lbsUrl;
		1 !== e && 2 !== e && (e = 0), r.ipVersion = e;
		var s = (new Date).getTime();
		this.doRequestLbs(n).then(e => {
			c.call(t, e, n)
		}).catch(e => {
			if (t.logger.error(`link::refreshSocketUrl: ${n} ajax lbs error`, e), d.call(t, n,
					e, s), t.options.lbsBackup) {
				var i = t.options.lbsBackupUrlsCustomer || [],
					o = [];
				r.hasLocalStorage && (o = (o = localStorage.getItem("nim_lbs_backup")) ? JSON
					.parse(o) : []);
				var a = o.concat(i);
				g.call(t, a)
			} else p.call(t)
		})
	}, s.doRequestLbs = function(e) {
		var t = this.options,
			n = r.info;
		return e = e + o.genUrlSep(e) + "id=" + t.account + "&sv=" + n.sdkVersion + "&pv=" + n
			.protocolVersion + "&networkType=" + r.ipVersion + "&k=" + t.appKey, this.logger.info(
				"doRequestLbs " + e.slice(0, -32)), new Promise((t, n) => {
				r.isWeixinApp ? wx.request({
					url: e,
					success: function(e) {
						var s = e && e.statusCode,
							r = e && e.data;
						200 === s ? t(r) : n(r)
					},
					fail: function(e) {
						n(e)
					}
				}) : a(e, {
					proxyUrl: o.url2origin(e) + "/lbs/res/cors/nej_proxy_frame.html",
					timeout: r.xhrTimeout,
					onload: function(e) {
						t(JSON.parse(e))
					},
					onerror: function(e) {
						n(e)
					}
				})
			})
	};
	var m = [],
		u = null;
	if (r.hasLocalStorage) {
		var l = localStorage.getItem("nim_lbs_fail_report_time");
		l = l ? parseInt(l) : 6e4, u = o.throttle((function() {
			if (m.length > 0) {
				var e = JSON.stringify(m);
				a("https://statistic.live.126.net/statics/report/im/api/error", {
					method: "POST",
					timeout: 2e3,
					headers: {
						"Content-Type": "application/json"
					},
					data: e,
					onload() {},
					onerror() {
						var t = JSON.parse(e).concat(m);
						m = t.reduce((e, t) => (e.some(e => e.request_url === t.url && e
							.error_code === t.code) || e.push(t), e), [])
					}
				}), m = []
			}
		}), l, {
			leading: !1
		})
	}

	function d(e, t, n) {
		var s = (new Date).getTime(),
			o = t.status || 10001;
		(i.updateUniErrCache("login", {
			operation_type: "HTTP",
			target: e
		}), this.api.reportLogs({
			event: "nimlb",
			code: 3001
		}), m.some(t => t.request_url === e && t.error_code === o) || m.push({
			request_url: e,
			appkey: this.options.appKey,
			accid: this.options.account,
			timestamp: s,
			error_code: o,
			platform: "web",
			send_time: s - n
		}), r.hasLocalStorage) && ("0" !== localStorage.getItem("nim_lbs_fail_report_on") && u && u())
	}

	function p() {
		var e = r.getDefaultLinkUrl(this.options.secure);
		e ? (this.logger.warn("link::refreshSocketUrl: use default link url", e), this.connectToUrl(e)) :
			this.onDisconnect("link::refreshSocketUrl")
	}

	function g(e) {
		var t = this;
		if (!(e && e.length > 0)) return i.updateUniErrCache("login", {
			operation_type: "HTTP",
			error: "no backup lbs"
		}), void p.call(t);
		t.logger.info("doRequestBackupLbsUrls: use backup lbs url", e);
		var n = 0,
			s = 0,
			r = !1,
			o = setInterval(() => {
				if (n >= e.length) return o && clearInterval(o), void t.logger.warn(
					"doRequestBackupLbsUrls backup lbs all tried");
				const i = e[n++];
				var a = (new Date).getTime();
				t.doRequestLbs(i).then(e => {
					o && clearInterval(o), !1 === r && c.call(t, e, i), r = !0
				}).catch(n => {
					s++, t.logger.error(`doRequestBackupLbsUrls: ${i} ajax lbs error`, n), d
						.call(t, i, n, a), s >= e.length && (o && clearInterval(o), t.logger
							.warn("doRequestBackupLbsUrls: backup lbs all failed"), p.call(t))
				})
			}, 2e3)
	}
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(26);
	s.assembleLogin = function() {
			var e = this.assembleIMLogin();
			return this.addPushInfo instanceof Function ? this.addPushInfo(e) : Promise.resolve({
				login: e
			})
		}, s.afterLogin = function() {
			var e = this;
			e.sendCmd("getNosCdnHost", {});
			var t = (new Date).getTime();
			e.sendCmd("getServerTime", {}, (function(n, s) {
				if (n) e.logger.error("Calculate Delay time, getServerTime error", n);
				else if (s) {
					var r = (new Date).getTime(),
						i = (r - t) / 2,
						o = s.getTime ? s.getTime() : s;
					e.relativeSeverTime = parseInt(r - o - i)
				} else e.logger.warn("Calculate Delay time, getServerTime not correct")
			})), this.initPush instanceof Function && this.initPush();
			const n = this.db;
			if (n.enable) {
				let e = this.account;
				this.options.appendAppKeyForDBName && (e += "-" + this.options.appKey), this.db.init(e)
					.then(() => {
						this.notifyLogin(), this.syncData()
					}, e => {
						this.logger.warn("link::afterLogin: no db", e), n.reset(!1), this.notifyLogin(),
							this.syncData()
					})
			} else this.logger.info("link::afterLogin: no db"), this.notifyLogin(), this.syncData()
		}, s.processAuth = function(e) {
			switch (e.cmd) {
				case "login":
					e.error || (e.content = e.content || {}, this.loginAndroidPush && this.loginAndroidPush(
							e.content.aosPushInfo || {}), e.obj = e.content.loginRes, this
						.connectionId = e.content.loginRes.connectionId, this.onLoginPortsChange(e, 2));
					break;
				case "kicked":
					return void this.onKicked(e);
				case "multiPortLogin":
					this.onLoginPortsChange(e, e.content.state);
					break;
				case "kick":
					e.error || (e.obj.deviceIds = e.content.deviceIds)
			}
		}, s.onLoginPortsChange = function(e, t) {
			var n = this,
				s = e.content.loginPorts;
			if (s && s.length) {
				var i = !0;
				switch (t) {
					case 2:
						i = !0;
						break;
					case 3:
						i = !1
				}
				if (s.forEach((function(e) {
						e.type = r.reverseType(e.type), e.customClientType && (e
								.customClientType = +e.customClientType), e.time = +e.time, e
							.online = i
					})), (s = s.filter((function(e) {
						return e.connectionId !== n.connectionId
					}))).length) {
					n.logger.info("link::onLoginPortsChange:", s);
					try {
						n.options.onloginportschange(s)
					} catch (e) {
						throw n.logger.error("userOption:onloginportschange function error", e), e
					}
				}
			}
		}, s.kickedReasons = ["", "samePlatformKick", "serverKick", "otherPlatformKick", "silentlyKick"], s
		.kickedMessages = ["", "不允许同一个帐号在多个地方同时登录", "被服务器踢了", "被其它端踢了", "悄悄被踢"]
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(0);
	const i = n(4);
	var o = r.undef,
		a = r.objs2ids,
		c = r.objs2accounts,
		m = r.teams2ids,
		u = n(27),
		l = r.getGlobal();
	s.beforeSync = function() {
		var e = this.db;
		return e.enable ? e.clearSendingMsgs() : Promise.resolve()
	}, s.syncData = function() {
		var e = this,
			t = e.db,
			n = e.options,
			s = t.enable;

		function i(t) {
			e.syncPromiseArray = [], e.syncResult = {}, e.syncTeamMembersPromiseArray = [], e
				.syncSuperTeamMembersPromiseArray = [], e.syncTeamMembersResult = {}, e.checkNosReqNum =
				0, e.getNosOriginUrlReqNum = 0, r.verifyBooleanWithDefault(n,
					"syncRelations syncFriends syncFriendUsers syncTeams syncSuperTeams syncRoamingMsgs syncSuperTeamRoamingMsgs syncMsgReceipts syncExtraTeamInfo",
					!0, "", "sync::syncData"), r.verifyBooleanWithDefault(n,
					"syncFilter syncTeamMembers syncSuperTeamMembers", !1, "", "sync::syncData");
			var i = {};
			t = t || {}, l._nimForceSyncIM && (e.logger.warn("sync::syncData: nimForceSyncIM"), delete t
					.teams, l._nimForceSyncIM = !1), i.myInfo = t.myInfo || 0, i.deleteMsgSelf = t
				.deleteMsgSelf || 0, i.offlineMsgs = 0, n.syncRelations && (i.relations = t.relations ||
					0), n.syncFriends && (i.friends = t.friends || 0), n.syncFriendUsers && (i
					.friendUsers = t.friendUsers || 0), n.syncRobots && (i.robots = t.robots || 0), n
				.syncTeams && (i.teams = t.teams || 0), n.syncSuperTeams && (i.superTeams = t
					.superTeams || 0), n.syncStickTopSessions && (i.stickTopSessions = t
					.stickTopSessions || 0), n.syncSessionUnread && (i.sessionAck = s && t.sessionAck ||
					0, i.superTeamSessionAck = s && t.superTeamSessionAck || 0), n.syncRoamingMsgs && (i
					.roamingMsgs = s && t.roamingMsgs || t.roamingMsgs || 0), n
				.syncSuperTeamRoamingMsgs && (i.superTeamRoamingMsgs = s && t.superTeamRoamingMsgs ||
				0), n.syncMsgReceipts && (i.msgReceipts = t.msgReceipts || 0), n.syncExtraTeamInfo && (i
					.myTeamMembers = t.myTeamMembers || 0), n.syncBroadcastMsgs && (i.broadcastMsgs = t
					.broadcastMsg || 0), i.donnop = t.donnop || 0, i.deleteMsg = t.deleteMsg || 0, i
				.deleteSuperTeamMsg = t.deleteSuperTeamMsg || 0, i.sessionHistoryMsgsDelete = t
				.sessionHistoryMsgsDelete || 0, i.netcallMsgs = 0, n.syncFilter && (i.filterMsgs = 0);
			var o = e.onSyncData.bind(e);
			o.isImSyncDataCb = !0, e.logger.info("syncData:: start sync", i), e.sendCmd("sync", {
				sync: i,
				isImSyncDataObj: !0
			}, o)
		}
		e.syncing = !0, s ? e.beforeSync().then((function() {
			return e.db.getTimetags()
		})).then((function(e) {
			i(e)
		}), (function() {
			i()
		})) : i(e.timetags)
	}, s.onSyncData = function(e, t) {
		e && this.syncRetryTimes > 3 && (this.syncRetryTimes = 0, e.callFunc = "sync::onSyncData", this
			.onCustomError("SYNC_DATA_ERROR", e))
	}, s.processSync = function(e) {
		switch (this.syncRetryTimes = this.syncRetryTimes || 0, this.syncRetryTimes++, e.cmd) {
			case "syncDone":
				e.error ? this.syncRetryTimes > 3 || this.syncData() : (this.timetags.sync = e.content
					.timetag, this.onSyncDone());
				break;
			case "syncTeamMembersDone":
				this.onSyncTeamMembersDone()
		}
	}, s.onSyncDone = function(e) {
		var t, n, s, l, d, p, g, f, h, y, v, b, T, S, M, k, C, P, I, A, w, x, O, _, E, R, U, j, D =
			this,
			L = D.db,
			N = L.enable,
			F = D.options,
			B = D.syncPromiseArray,
			q = D.syncResult;

		function H() {
			if (B) {
				D.logger.info("sync::onSyncDone: after sync", r.promises2cmds(B)), B = [], n = q
					.blacklist || [], s = q.invalidBlacklist || [], l = q.mutelist || [], d = q
					.invalidMutelist || [], p = q.friends, g = q.invalidFriends || [], f = q.myInfo, h =
					q.users, v = q.superTeams, T = q.invalidSuperTeams, y = q.teams, b = q
					.invalidTeams || [], S = q.sessions || {}, M = Object.values(Object.assign({}, D
						.sessionSet)), k = q.ackMap, q.msgReceipts, C = q.roamingMsgs, P = q
					.offlineMsgs, I = q.offlineFilterMsgs, w = q.offlineSysMsgs, x = q
					.offlineCustomSysMsgs, O = q.offlineFilterSysMsgs, _ = q.offlineFilterCustomSysMsgs,
					q.broadcastMsgs, E = q.sysMsgUnread, R = q.sessionsWithMoreRoaming, j = q
					.clearServerHistoryMsgs || [];
				var e = Promise.resolve();
				! function() {
					if (N) {
						var t = [$()];
						S && Object.keys(S).forEach(e => {
							t.push(L.putSession(S[e]))
						}), e = Promise.all(t).then(() => {
							let e = [...Object.keys(k || {}), ...Object.keys(S || {})];
							e = e.filter((e, t, n) => n.indexOf(e) === t);
							let t = [];
							return e.forEach(e => {
								let n, s = S[e];
								(s.lastMsg || s.ack) && (n = s.ack ? Promise.resolve(
									s) : L.getSession(s.id), n = n.then(t => {
										let n = t.ack || 0;
										return L.getMsgCountAfterAck({
											shouldCountNotifyUnread: D
												.options
												.shouldCountNotifyUnread,
											sessionId: e,
											ack: n
										}).then(n => (t.unread = n || 0, S[e] =
											D.mergeSession(t), L
											.updateSession(t)))
									}), t.push(n))
							}), Promise.all(t)
						}).then(() => {
							var e = [];
							return D.saveAck.p2pTeam && e.push(L.updateSessionAck(D.saveAck
								.p2pTeam).catch(e => (D.logger.error(
								"sessionAck::syncSessionAck::updatetimetag db",
								e), Promise.reject(e)))), D.saveAck.superTeam && e.push(L
								.updateSuperTeamSessionAck(D.saveAck.superTeam).catch(e => (
									D.logger.error(
										"sessionAck::syncSuperTeamSessionAck::updatetimetag db",
										e), Promise.reject(e)))), Promise.all(e)
						})
					} else if (S) {
						var n, s;
						[C, P].forEach(e => {
							e && e.forEach(e => {
								(n = S[e.sessionId]).unread = n.unread || 0, n
									.unreadMsgs = n.unreadMsgs || [], s = n.ack || 0, e
									.msgs.forEach(e => {
										if (!(s >= e.time))
											if ("notification" === e.type) {
												let t;
												try {
													t = D.options
														.shouldCountNotifyUnread(e)
												} catch (e) {
													throw D.logger.error(
														"userOption:shouldCountNotifyUnread function error",
														e), e
												}
												t && n.unread++
											} else "in" === e.flow && !1 !== e
												.isUnreadable && (n.unread++, n
													.unreadMsgs.push(e))
									}), D.mergeSession(n)
							})
						})
					}
				}(), e.then(() => {
					if (N && !D.hasSynced) D.hasSynced = !0,
						function() {
							F.syncRelations && (t = L.getRelations().then(e => {
								n = e[0], l = e[1], n.invalid = s, l.invalid = d
							}).catch(e => (e._msg = "on relations error", D.logger
								.error("sync::syncRelation: ", e), Promise.reject(e)
								)), B.push(t));
							F.syncFriends && (t = L.getFriends().then(e => {
								(p = e).invalid = g
							}).catch(e => (e._msg = "on friends error", D.logger.error(
								"sync::syncFriends: ", e), Promise.reject(e))), B.push(
								t));
							o(f) && (t = L.getUser(D.account).then(e => {
									f = e
								}).catch(e => (e._msg = "on myInfo error", D.logger.error(
									"sync::syncMyInfo: ", e), Promise.reject(e))), B.push(
								t));
							F.syncFriendUsers && (t = L.getFriends().then((function(e) {
									return e.map(e => e.account)
								})).then((function(e) {
									return L.getUsers(e)
								})).then(e => {
									h = e
								}).catch(e => (e._msg = "on users error", D.logger.error(
									"sync::syncFriendUser: ", e), Promise.reject(e))), B
								.push(t));
							F.syncTeams && (t = L.getTeams().then(e => {
								(y = e).invalid = b
							}).catch(e => (e._msg = "on teams error", D.logger.error(
								"sync::syncTeams: ", e), Promise.reject(e))), B.push(t));
							F.syncSuperTeams && (t = L.getSuperTeams().then(e => {
								(v = e).invalid = T
							}).catch(e => (e._msg = "on superteams error", D.logger
								.error("sync::syncSuperTeams: ", e), Promise.reject(
									e))), B.push(t));
							t = L.getTeamMembersByAccount(D.account).then((function(e) {
									D.mergeMyTeamMembers(e)
								})).catch(e => (D.logger.error(
										"sync::getTeamMembersByAccount: ", e), Promise
									.reject(e))), B.push(t), t = L.getDonnop().then((function(
								e) {
									D.mergeDonnop(e)
								})).catch(e => (D.logger.error("sync::donnop: ", e), Promise
									.reject(e))), B.push(t), t = L.getAllSessions().then((
									function(e) {
										S = e
									})).catch(e => (D.logger.error("sync::getSession: ", e),
									Promise.reject(e))), B.push(t), t = L.getSysMsgUnread()
								.then(e => {
									E = e
								}).catch(e => (e._msg = "on sysMsgUnread error", D.logger.error(
									"sync::getSysMsgUnread: ", e), Promise.reject(e))), B.push(
									t), B.push(L.getSessionsWithMoreRoaming().then(e => {
									R = e
								}))
						}();
					else {
						let e, t = [];
						Object.keys(S).forEach((function(n) {
							e = S[n], e.lastMsg && t.push(e)
						})), S = t.sort((function(e, t) {
							return t.updateTime - e.updateTime
						}))
					}
					Promise.all(B).then(W).then(z, (function(e) {
						D.logger.error("taskAfterSync syncDBDataPromise error:", e),
							e.callFunc = "sync::onSyncDone", e.message =
							"taskAfterSync syncDBDataPromise 出错", D.onCustomError(
								"SYNC_SESSION_ACK_ERROR", e)
					}))
				})
			} else D.logger.warn("sync::onSyncDone: after sync --no promiseArray")
		}

		function $() {
			var e = [];
			return C && C.forEach((function(t) {
				e = [...e, ...t.msgs]
			})), P && P.forEach((function(t) {
				e = [...e, ...t.msgs]
			})), e.length ? L.putMsg(e).then(() => e) : Promise.resolve(e)
		}

		function W() {
			D.logger.info("sync::onSyncDone: taskAfterSync"),
				function() {
					if (q.deleteMsgSysMsgs) {
						var e = {};
						C && C.forEach((function(t) {
							e[t.sessionId] = t
						}));
						var t = {};
						P && P.forEach((function(e) {
							t[e.sessionId] = e
						}));
						var n = D.api;
						if (q.deleteMsgSysMsgs.forEach((function(s) {
								s.sysMsgs.forEach((function(r) {
									var i = r.msg,
										o = i.sessionId;
									"roaming" === s.type && e[o] ? e[o].msgs = n
										.cutMsgs(e[o].msgs, i) : t[o] && (t[o]
											.msgs = n.cutMsgs(t[o].msgs, i))
								}))
							})), !L.enable) {
							[...C || [], ...P || []].forEach((function(e) {
								if (e.msgs.length) {
									var t = D.genSessionByMsgs(e.msgs);
									D.cacheSyncedSession(t), S.unshift(t)
								} else {
									const t = S.findIndex(t => t.id === e.sessionId);
									S.splice(t, 1)
								}
							}));
							const e = {};
							S.forEach(t => {
								if (e[t.id]) {
									const n = t.lastMsg.time > e[t.id].lastMsg.time ? t
										.lastMsg : e[t.id].lastMsg;
									e[t.id] = t, e[t.id].lastMsg = n
								} else e[t.id] = t
							}), S = (S = Object.values(e)).sort((e, t) => t.updateTime - e
								.updateTime)
						}
					}
				}(), (U = D.syncResult.stickTopSessions || []).forEach((e, t) => {
					U[t] = D.mergeSession(e)
				}), S.forEach((e, t) => {
					const n = D.sessionSet[e.id];
					n && n.isTop && (e.isTop = !0)
				});
			var e = [D.deleteMsgOfflineRoaming(q.deleteMsgSysMsgs, S)];
			return j && j.forEach(t => {
				e.push(function(e, t) {
					var n;
					D.logger.info("sync::taskAfterSync:sessionHistoryMsgsDelete " + e),
						t = t || (new Date).getTime();
					let s = S.filter(t => t.id === e),
						r = D.findSession(e);
					n = r || s[0];
					var i = !1 !== F.rollbackClearMsgsUnread,
						o = [];
					L.enable && o.push(L.deleteMsgsBySessionId({
						sessionId: e,
						end: t
					}));
					i && n && (n.lastMsg = null, n.unread = 0, n = D.mergeSession(n), L
						.enable && o.push(L.updateSession(n)));
					return Promise.all(o)
				}(t.sessionId, t.time))
			}), Promise.all(e)
		}

		function z() {
			setTimeout(J, 0)
		}

		function J() {
			var e, t, s = [],
				i = [];
			if (n && n.length) {
				D.logger.info("sync::notifyDataAsync: on blacklist", c(n));
				try {
					F.onblacklist(n)
				} catch (e) {
					throw D.logger.error("userOption:onblacklist function error", e), e
				}
			}
			if (l && l.length) {
				D.logger.info("sync::notifyDataAsync: on mutelist", c(l));
				try {
					F.onmutelist(l)
				} catch (e) {
					throw D.logger.error("userOption:onmutelist function error", e), e
				}
			}
			if (p) {
				D.logger.info("sync::notifyDataAsync: on friends", c(p));
				try {
					F.onfriends(p)
				} catch (e) {
					throw D.logger.error("userOption:onfriends function error", e), e
				}
			}
			if (f) {
				D.logger.info("sync::notifyDataAsync: on myInfo"), D.myInfo = f;
				try {
					F.onmyinfo(r.copy(f))
				} catch (e) {
					throw D.logger.error("userOption:onmyinfo function error", e), e
				}
			}
			if (h) {
				h.forEach((function(e) {
					D.mergeUser(e)
				})), D.logger.info("sync::notifyDataAsync: on users", c(h));
				try {
					F.onusers(h)
				} catch (e) {
					throw D.logger.error("userOption:onusers function error", e), e
				}
			}
			if (y) {
				D.logger.info("sync::notifyDataAsync: on teams", m(y));
				try {
					F.onteams(y)
				} catch (e) {
					throw D.logger.error("userOption:onteams function error", e), e
				}
			}
			if (v) {
				D.logger.info("sync::notifyDataAsync: onSuperTeams", m(v));
				try {
					F.onSuperTeams(v)
				} catch (e) {
					throw D.logger.error("userOption:onSuperTeams function error", e), e
				}
			}
			if (S && S.length) {
				S = S.filter((function(e) {
					return D.mergeSession(e), !e.isDeleted && (u.trim(e), !0)
				})), D.logger.info("sync::notifyDataAsync: on sessions", a(S), r.secureOutput(
					"session", S));
				try {
					!N && D.timetags && D.timetags.roamingMsgs ? F.onsessions(M.filter(e => u
						.isComplete(e))) : F.onsessions(S)
				} catch (e) {
					throw D.logger.error("userOption:onsessions function error", e), e
				}
			} else if (!N && M.length) {
				D.logger.info("sync::notifyDataAsync: on sessions", a(S), r.secureOutput("session", S));
				try {
					F.onsessions(M)
				} catch (e) {
					throw D.logger.error("userOption:onsessions function error", e), e
				}
			}
			if (U && U.length) {
				U.forEach((function(e) {
					D.mergeSession(e), u.trim(e)
				})), D.logger.info("sync::notifyDataAsync: onStickTopSessions", a(U), r
					.secureOutput("session", U));
				try {
					F.onStickTopSessions(U)
				} catch (e) {
					throw D.logger.error("userOption:onStickTopSessions function error", e), e
				}
			}
			if (C && C.forEach((function(e) {
					if ("superTeam" === e.scene ? i.push(e.timetag) : s.push(e.timetag), (t = e
							.msgs).length) {
						D.logger.info("sync::notifyDataAsync: on roaming msgs", e.sessionId, t
							.length);
						try {
							F.onroamingmsgs(e)
						} catch (e) {
							throw D.logger.error("userOption:onroamingmsgs function error", e),
								e
						}
					}
				})), P && P.forEach((function(e) {
					if ("superTeam" === e.scene ? i.push(e.timetag) : s.push(e.timetag), (t = e
							.msgs).length) {
						D.logger.info("sync::notifyDataAsync: on offline msgs", e.sessionId, t
							.length, t.map(e => e.idServer));
						try {
							F.onofflinemsgs(e)
						} catch (e) {
							throw D.logger.error("userOption:onofflinemsgs function error", e),
								e
						}
					}
				})), I && I.forEach((function(e) {
					if (s.push(e.timetag), (t = e.msgs).length) {
						D.logger.info("sync::notifyDataAsync: on offline filter msgs", e
							.sessionId, t.length);
						try {
							F.onofflinefiltermsgs(t)
						} catch (e) {
							throw D.logger.error(
								"userOption:onofflinefiltermsgs function error", e), e
						}
					}
				})), R) {
				D.logger.info("sync::notifyDataAsync: on sessionsWithMoreRoaming", a(R), R);
				try {
					F.onSessionsWithMoreRoaming(R)
				} catch (e) {
					throw D.logger.error("userOption:onSessionsWithMoreRoaming function error", e), e
				}
			}
			var o = [],
				d = [];
			if (q.deleteMsgSysMsgs && q.deleteMsgSysMsgs.forEach((function(e) {
					"roaming" === e.type ? o = o.concat(e.sysMsgs) : d = d.concat(e.sysMsgs)
				})), o.length && (A = (A = A || []).concat(o)), d.length && (w = (w = w || []).concat(
					d)), A) {
				D.logger.info("sync::notifyDataAsync: on roaming sys msgs", A.length);
				try {
					F.onroamingsysmsgs(A)
				} catch (e) {
					throw D.logger.error("userOption:onroamingsysmsgs function error", e), e
				}
			}
			if (w) {
				D.logger.info("sync::notifyDataAsync: on offline sys msgs", w.length);
				try {
					F.onofflinesysmsgs(w)
				} catch (e) {
					throw D.logger.error("userOption:onofflinesysmsgs function error", e), e
				}
			}
			if (O) {
				D.logger.info("sync::notifyDataAsync: on offline filter sys msgs", O.length);
				try {
					F.onofflinefiltersysmsgs(O)
				} catch (e) {
					throw D.logger.error("userOption:onofflinefiltersysmsgs function error", e), e
				}
			}
			if (x) {
				D.logger.info("sync::notifyDataAsync: on offline custom sys msgs", x.length);
				try {
					F.onofflinecustomsysmsgs(x)
				} catch (e) {
					throw D.logger.error("userOption:onofflinecustomsysmsgs function error", e), e
				}
			}
			if (_) {
				D.logger.info("sync::notifyDataAsync: on offline filter custom sys msgs", _.length);
				try {
					F.onofflinefiltercustomsysmsgs(_)
				} catch (e) {
					throw D.logger.error("userOption:onofflinefiltercustomsysmsgs function error", e), e
				}
			}
			if (E) {
				E = r.merge({}, D.sysMsgUnread, E), D.sysMsgUnread = r.merge({}, E), D.logger.info(
					"sync::notifyDataAsync: on sysMsgUnread", E);
				try {
					F.onsysmsgunread(E)
				} catch (e) {
					throw D.logger.error("userOption:onsysmsgunread function error", e), e
				}
			}
			var g = D.getPushNotificationMultiportConfig();
			D.logger.info("sync::notifyDataAsync: on pushNotificationMultiportConfig", g);
			try {
				F.onPushNotificationMultiportConfig(g)
			} catch (e) {
				throw D.logger.error("userOption:onPushNotificationMultiportConfig function error", e),
					e
			}
			let b = i.length && Math.max.apply(Math, i);
			if (e = s.length && Math.max.apply(Math, s), L.enable) {
				let t = [];
				b && t.push(D.db.updateSuperTeamRoamingMsgTimetag(b)), e && t.push(D.db
					.updateRoamingMsgTimetag(e)), Promise.all(t).then(Q).catch(Q)
			} else D.timetags.superTeamRoamingMsgs = b, D.timetags.roamingMsgs = e || D.timetags
				.roamingMsgs, Q();
			D.syncPromiseArray = [], D.syncResult = {}
		}

		function Q() {
			if (D.processUnsettledMsgs(), D.processUnsettledSysMsgs(), D.syncing) try {
				F.onsyncdone()
			} catch (e) {
				throw D.logger && D.logger.error("userOption:onsyncdone function error", e), e
			}
			if (D.syncing = !1, F.syncTeamMembers && y && y.length) throw new i(
				"sync team members api deprecated!")
		}
		B && B.length ? Promise.all(B).then(H).catch(e => {
			H(), D.logger.error(e), e.callFunc = "sync::onSyncDone", e.message =
				"afterSync syncNormalPromise 出错", D.onCustomError("SYNC_promiseArray_ERROR", e)
		}) : H()
	}, s.syncTeamMembers = function(e) {
		var t, n, s = this;
		t = s.timetags, n = {}, t = t || {}, e.forEach((function(e) {
			n[e.teamId] = 0
		}), s), s.sendCmd("syncTeamMembers", {
			sync: n
		}, s.onSyncTeamMembers.bind(s))
	}, s.onSyncTeamMembers = function(e, t) {
		e.callFunc = "sync::onSyncTeamMembers", e.message = "同步群成员错误", this.onCustomError(
			"SYNC_TEAM_MEMBERS_ERROR", e)
	}, s.onSyncTeamMembersDone = function() {
		var e, t = this,
			n = t.db,
			s = t.options,
			i = t.syncTeamMembersResult,
			o = t.syncTeamMembersPromiseArray;

		function a() {
			t.logger.log("sync::onSyncTeamMembersDone: afterSync", r.promises2cmds(o)), o = [], n
				.enable && !t.hasSyncedTeamMembers ? (t.hasSyncedTeamMembers = !0, function() {
					if (!s.syncTeams || !s.syncTeamMembers) return l();
					n.getTeams().then((function(n) {
						n.forEach((function(n) {
							var s = n.teamId;
							e = new Promise((function(e, n) {
								t.api.getTeamMembers({
									teamId: s,
									done: function(t,
									r) {
										t && n({
												callFunc: "sync::getTeamMembers: teamId-" +
													s,
												message: "sync team members error"
											}), i[
											s] = r
											.members ||
											[], e()
									}
								})
							})), o.push(e)
						})), o.length ? Promise.all(o).then(m, (function(e) {
							e.callFunc = "sync::onSyncTeamMembersDone", e
								.message =
								"pullFullData promiseArray notifyData 错误", t
								.onCustomError("SYNC_TEAM_MEMBERS_ERROR", e)
						})) : m()
					}), (function(e) {
						e.callFunc = "sync::onSyncTeamMembersDone", e.message =
							"pullFullData getTeams 错误", t.onCustomError(
								"SYNC_TEAM_MEMBERS_ERROR", e)
					}))
				}()) : m()
		}

		function m() {
			setTimeout(u, 0)
		}

		function u() {
			var e, n;
			Object.keys(i).forEach((function(r) {
				-1 === r.indexOf("invalid") && (e = i[r], n = i[r + "-invalid"] || [], e
					.invalid = n,
					function(e, n) {
						t.logger.info("sync::onSyncTeamMembersDone: onTeamMembers", e,
							c(n), n);
						try {
							s.onteammembers({
								teamId: e,
								members: n
							})
						} catch (e) {
							throw t.logger.error(
								"userOption:onteammembers function error", e), e
						}
					}(r, e))
			})), l()
		}

		function l() {
			t.logger.info("sync::onSyncTeamMembersDone: bingo");
			try {
				s.onsyncteammembersdone()
			} catch (e) {
				throw t.logger.error("userOption:onsyncteammembersdone function error", e), e
			}
			t.syncTeamMembersResult = null, t.syncTeamMembersPromiseArray = null
		}
		o.length ? Promise.all(o).then(a, (function(e) {
			e.callFunc = "sync::onSyncTeamMembersDone", e.message =
				"同步群成员 syncTeamMembersPromiseArray 错误", t.onCustomError(
					"SYNC_TEAM_MEMBERS_ERROR", e)
		})).catch(e => {
			t.logger.log("sync::onSyncTeamMembersDone: syncTeamMembersPromiseArray promise ",
				e), a()
		}) : a()
	}
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(0),
		i = r.objs2accounts,
		o = n(125),
		a = n(30);
	s.processUser = function(e) {
		var t, n = this,
			s = n.db,
			r = e.obj,
			i = e.error,
			o = e.content;
		switch (e.cmd) {
			case "markInBlacklist":
				i || n.markInBlacklist(r);
				break;
			case "syncMarkInBlacklist":
				n.markInBlacklist(o, !0);
				break;
			case "markInMutelist":
				i || n.markInMutelist(r);
				break;
			case "syncMarkInMutelist":
				n.markInMutelist(o, !0);
				break;
			case "getRelations":
				i || n.onRelations(e);
				break;
			case "syncMyInfo":
				n.onMyInfo(e, !0);
				break;
			case "updateMyInfo":
				i || (r.user.updateTime = o.timetag, n.onUpdateMyInfo(e, r.user));
				break;
			case "syncUpdateMyInfo":
				n.onUpdateMyInfo(e, o.user, !0);
				break;
			case "getUsers":
				i || (t = o.users.map((function(e) {
					return e = a.reverse(e), n.mergeUser(e), e
				})), e.obj = t, s.enable && s.putUsers(t));
				break;
			case "updateDonnop":
				n.onUpdateDonnop(e);
				break;
			case "syncUpdateDonnop":
				n.onDonnop(e, !1)
		}
	}, s.onMyInfo = function(e) {
		let t, n = this,
			s = n.db,
			r = e.error,
			i = e.content,
			o = new Promise((e, o) => {
				var m, u;
				r ? (r && (r.callFunc = "user::onMyInfo"), e(r), n.syncData()) : (t = a.reverse(i
					.user), s.enable ? (m = e, u = o, s.mergeMyInfo(t, !0).then(() => {
					c(), m()
				}).then(void 0, e => {
					e.message = "db.mergeMyInfo error", e.callFunc =
						"user::onMyInfo", u(e)
				})) : (c(), e()))
			}).catch(e => (n.logger.error("user::onMyInfo: ", e), Promise.reject(e)));

		function c() {
			n.timetags.myInfo = t.updateTime, n.syncResult.myInfo = t
		}
		o.cmd = "myInfo", n.syncPromiseArray.push(o)
	}, s.onUpdateMyInfo = function(e, t, n) {
		let s = this,
			i = s.db,
			o = a.reverse(t),
			c = r.merge(s.myInfo, o);
		if (s.myInfo = c, n) {
			s.logger.info("user::onUpdateMyInfo:", c && c.account);
			try {
				s.options.onupdatemyinfo(c)
			} catch (e) {
				throw s.logger.error("userOption:onupdatemyinfo function error", e), e
			}
		} else e.obj = c;
		i.enable && (o.account = s.account, i.updateUser(o))
	}, s.onRelations = function(e) {
		let t, n = this,
			s = n.db,
			r = e.error,
			a = n.packetFromSync(e),
			c = e.content.specialRelations,
			m = !0,
			u = [],
			l = [],
			d = [],
			p = [],
			g = new Promise((g, h) => {
				var y, v;
				r ? a && (g(r), n.syncData()) : (c.forEach(e => {
						var t = {
							account: (e = o.parse(e)).account,
							createTime: e.createTime,
							updateTime: e.updateTime
						};
						e.isBlacked ? u.push(t) : l.push(t), e.isMuted ? d.push(t) : p.push(
							t)
					}), n.logger.info("user::onRelations: parse blacklist", i(u), u, "delete",
						i(l), l), n.logger.info("user::onRelations: parse mutelist", i(d), d,
						"delete", i(p), p), c.length ? (m = !0, t = e.content.timetag) : m = !1,
					s.enable ? (y = g, v = h, e.promise = new Promise((function(e, r) {
						function i() {
							a ? (f(), e(), y()) : s.getRelations().then((function(
							t) {
								u = t[0], d = t[1], f(), e(), y()
							})).then(void 0, (function(e) {
								e.message = "db.getRelations error", e
									.callFunc = "user::onRelations", r(
										e), v(e)
							}))
						}
						m ? s.mergeRelations(u, l, d, p, t).then((function() {
							i()
						})).then(void 0, (function(e) {
							e.message = "db.mergeRelations error", e
								.callFunc = "user::onRelations", r(e),
								v(e)
						})) : (n.logger.warn(
								"user::onRelations: no relations need merge"),
							i())
					})).then(void 0, (function(e) {
						throw e.message = "merge relations data error", e.callFunc =
							"user::onRelations", v(e), e
					}))) : (f(), g()))
			}).catch(e => (n.logger.error("user::onRelations: ", e), Promise.reject(e)));

		function f() {
			n.timetags.relations = t, u.invalid = l, d.invalid = p, a ? (n.syncResult.blacklist = u, n
				.syncResult.mutelist = d, n.syncResult.invalidBlacklist = l, n.syncResult
				.invalidMutelist = p) : (n.logger.info("user::onRelations: get relations", u, d), e
				.obj.blacklist = u, e.obj.mutelist = d)
		}
		a && (g.cmd = "relations", n.syncPromiseArray.push(g))
	}, s.markInBlacklist = function(e, t) {
		var n = this.db;
		if (e.record = {
				account: e.account,
				updateTime: +new Date
			}, n.enable && n.markInBlacklist(e), t) {
			this.logger.info("user::markInBlacklist:", e);
			try {
				this.options.onsyncmarkinblacklist(e)
			} catch (e) {
				throw this.logger.error("userOption:onsyncmarkinblacklist function error", e), e
			}
		}
	}, s.markInMutelist = function(e, t) {
		var n = this.db;
		if (e.record = {
				account: e.account,
				updateTime: +new Date
			}, n.enable && n.markInMutelist(e), t) {
			this.logger.info("user::markInMutelist:", e);
			try {
				this.options.onsyncmarkinmutelist(e)
			} catch (e) {
				throw this.logger.error("userOption:onsyncmarkinmutelist function error", e), e
			}
		}
	}, s.mergeUser = function(e) {
		this.userSet[e.account] = e
	}
}, function(e, t, n) {
	var s = n(0);

	function r() {}
	r.parse = function(e) {
		var t = s.copy(e);
		return t.isBlacked = "1" === t.isBlacked, t.isMuted = "1" === t.isMuted, t.createTime = +t
			.createTime, t.updateTime = +t.updateTime, t
	}, e.exports = r
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(0),
		i = r.objs2accounts,
		o = n(93),
		a = n(30);
	s.processFriend = function(e) {
		let t = this,
			n = e.obj,
			s = e.content,
			r = e.error;
		switch (e.cmd) {
			case "friendRequest":
				t.updateFriendSysMsg(e), r || t.onFriendRequest(n);
				break;
			case "syncFriendRequest":
				t.onFriendRequest(s, !0);
				break;
			case "deleteFriend":
				r || t.onDeleteFriend(n);
				break;
			case "syncDeleteFriend":
				t.onDeleteFriend(s, !0);
				break;
			case "updateFriend":
				r || t.onUpdateFriend(n);
				break;
			case "syncUpdateFriend":
				t.onUpdateFriend(s.friend, !0);
				break;
			case "getFriends":
				t.getFriends(e);
				break;
			case "syncFriends":
				t.onFriends(e);
				break;
			case "syncFriendUsers":
				t.onFriendUsers(e)
		}
	}, s.getFriends = function(e) {
		const t = e.content.friends,
			n = [],
			s = [];
		t.forEach((function(e) {
			(e = o.reverse(e)).valid ? n.push(e) : s.push(e)
		})), n.invalid = s, e.obj = n
	}, s.onFriends = function(e) {
		var t, n = this,
			s = n.db,
			r = e.error,
			a = e.content.friends,
			c = !0,
			m = [],
			u = [],
			l = new Promise((function(l, p) {
				var g, f;
				r ? p(r) : (! function() {
					c && a.forEach((function(e) {
						(e = o.reverse(e)).valid ? m.push(e) : u.push(e)
					}));
					n.logger.info("friend::onFriends: parse friends", i(m), "delete", i(
						u)), a.length ? (c = !0, t = e.content.timetag) : c = !1
				}(), s.enable ? (g = l, f = p, e.promise = new Promise((function(e, r) {
					function i() {
						d(), e(), g()
					}
					c ? s.mergeFriends(m, u, t).then((function() {
						i()
					})).then(void 0, (function(e) {
						e._msg = "merge friends error", r(e), f(
							e)
					})) : (n.logger.info(
						"friend::onFriends: no merge friends"), i())
				})).then(void 0, (function(e) {
					throw e._msg = "merge friends data error", f(e), e
				}))) : (d(), l()))
			})).catch(e => (n.logger.error("friend::onFriends: ", e), Promise.reject(e)));

		function d() {
			n.timetags.friends = t, m.invalid = u, n.syncResult.friends = m, n.syncResult
				.invalidFriends = u
		}
		l.cmd = "friends", n.syncPromiseArray.push(l)
	}, s.onFriendRequest = function(e, t) {
		var n = Promise.resolve(),
			s = this.db,
			{
				type: r,
				...i
			} = e;
		if ("addFriend" === (r = e.type = o.getTypeFromByte(r) || r) || "passFriendApply" === r) {
			var a = e.friend = o.assembleFriend(i);
			s.enable && (n = s.putFriend(a))
		}
		return t && this.onSyncFriendAction(e), n
	}, s.onSyncFriendAction = function(e) {
		this.logger.info(`friend::onSyncFriendActionon: ${e.type}, `, e.account);
		try {
			this.options.onsyncfriendaction(e)
		} catch (e) {
			throw this.logger.error("userOption:onSyncFriendActionon function error", e), e
		}
	}, s.onDeleteFriend = function(e, t) {
		var n = Promise.resolve(),
			s = this.db;
		return s.enable && (n = s.deleteFriend(e.account)), t && (e.type = "deleteFriend", this
			.onSyncFriendAction(e)), n
	}, s.onUpdateFriend = function(e, t) {
		var n = this.db,
			s = o.reverse(e);
		n.enable && n.updateFriend(s), t && this.onSyncFriendAction({
			type: "updateFriend",
			friend: s
		})
	}, s.onFriendUsers = function(e) {
		var t = this.db,
			n = e.content,
			s = n.users.map((function(e) {
				return a.reverse(e)
			}));
		this.logger.info("friend::onFriendUsers: parse users", i(s));
		var r = n.timetag,
			o = Promise.resolve();
		t.enable && (o = t.mergeFriendUsers(s, r)), this.timetags.friendUsers = r, o.cmd =
			"friendUsers", this.syncPromiseArray.push(o), this.syncResult.users = s, this.syncing ||
			this.onSyncDone()
	}, s.updateFriendSysMsg = function(e) {
		var t, n, s = e.obj,
			i = e.error;
		if (e.obj.idServer) {
			if (i) t = "error", i = r.filterObj(i, "code message");
			else {
				var a = s.type;
				switch (a = o.getTypeFromByte(a) || a) {
					case "passFriendApply":
						t = "passed";
						break;
					case "rejectFriendApply":
						t = "rejected"
				}
			}
			n = {
				idServer: s.idServer,
				state: t
			}, i && (n.error = i), this.updateSysMsg(n)
		}
	}
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(0);
	s.onRobots = function(e) {
		let t = this,
			n = e.content;
		if (r.isFunction(t.options.onrobots) && Array.isArray(n.robots)) {
			let e = n.robots.filter(e => !!e.botid);
			e.length > 0 && t.options.onrobots(e || [])
		}
	}
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(0),
		i = r.objs2accounts,
		o = r.teams2ids,
		a = n(25),
		c = n(20);
	s.processTeam = function(e) {
		let t, n, s, r = this,
			i = e.error;
		switch (void 0 === e.obj && (e.obj = {}), e.cmd) {
			case "createTeam":
				t = e.obj.team, i || (t = e.content.team), t = a.reverse(t), e.obj.team = t, s = c
					.assembleOwner(t), e.obj.owner = s, i || (r.logger.info(
							"team::processTeam: create team ", t && t.teamId, s && s.account), r
						.onCreateTeam(t, s));
				break;
			case "syncCreateTeam":
				t = a.reverse(e.content.team), s = c.assembleOwner(t), r.logger.info(
					"team::processTeam: sync createTeam", t && t.teamId, s && s.account);
				try {
					r.options.onsynccreateteam(t, s)
				} catch (i) {
					throw r.logger.error("userOption:onsynccreateteam function error", i), i
				}
				r.onCreateTeam(t, s);
				break;
			case "sendSuperTeamMsg":
			case "sendTeamMsg":
				r.onSendMsg(e);
				break;
			case "teamMsg":
				r.onMsg(e);
				break;
			case "teamMsgs":
				r.onMsgs(e);
				break;
			case "addTeamMembers":
			case "removeTeamMembers":
			case "leaveTeam":
			case "dismissTeam":
			case "addTeamManagers":
			case "removeTeamManagers":
			case "transferTeam":
				break;
			case "updateInfoInTeam":
				i || (n = e.obj, n.account = r.account, n.id = c.genId(n.teamId, n.account), n = c
					.reverse(n), e.obj = n, r.mergeMyTeamMembers(n), r.onUpdateTeamMember(n));
				break;
			case "updateNickInTeam":
				e.obj = c.reverse(e.obj);
				break;
			case "updateTeam":
				e.obj = a.reverse(e.obj, !0);
				break;
			case "applyTeam":
				e.error || (e.obj = a.reverse(e.content.team));
				break;
			case "passTeamApply":
				r.updateTeamSysMsgState(e, "passed");
				break;
			case "rejectTeamApply":
				r.updateTeamSysMsgState(e, "rejected");
				break;
			case "acceptTeamInvite":
				r.updateTeamSysMsgState(e, "passed"), e.error || (e.obj = a.reverse(e.content.team));
				break;
			case "rejectTeamInvite":
				r.updateTeamSysMsgState(e, "rejected");
				break;
			case "getTeam":
				e.error || (e.obj = a.reverse(e.content.team));
				break;
			case "getTeams":
				r.onTeams(e);
				break;
			case "getTeamMembers":
				r.onTeamMembers(e);
				break;
			case "syncTeams":
				r.onTeams(e);
				break;
			case "syncTeamMembers":
				r.onTeamMembers(e);
				break;
			case "getTeamHistoryMsgs":
			case "searchTeamHistoryMsgs":
				r.onHistoryMsgs(e);
				break;
			case "syncSendTeamMsg":
				r.onMsg(e);
				break;
			case "notifyTeamMsgReads":
				r.onTeamMsgReceipt(e);
				break;
			case "syncUpdateTeamMember":
				n = c.reverse(e.content.teamMember), r.onUpdateTeamMember(n), n.account === r.account &&
					r.mergeMyTeamMembers(n);
				break;
			case "updateMuteStateInTeam":
				break;
			case "getMyTeamMembers":
				e.error || (e.obj = c.reverseMembers(e.content.teamMembers));
				break;
			case "getMutedTeamMembers":
				e.error || (e.obj = {
					teamId: e.obj.teamId,
					members: c.reverseMembers(e.content.teamMembers)
				});
				break;
			case "syncMyTeamMembers":
				r.onSyncMyTeamMembers(e);
				break;
			case "sendTeamMsgReceipt":
				r.sendTeamMsgReceipt(e);
				break;
			case "getTeamMsgReads":
				r.getTeamMsgReads(e);
				break;
			case "getTeamMsgReadAccounts":
				r.getTeamMsgReadAccounts(e);
				break;
			case "getTeamsById":
				r.getTeamsById(e)
		}
	}, s.getTeamMsgReads = function(e) {
		if (e.error) return void this.logger.error("team::sendTeamMsgReceipt: ", e.error);
		const t = r._get(e, "content.teamMsgReceipts") || [];
		if (this.db.enable) {
			const e = [];
			t.forEach(t => {
				t.idClient && e.push({
					idClient: t.idClient,
					unread: +t.unread,
					read: +t.read
				})
			}), e.length > 0 && setTimeout(() => this.db.updateMsgBatch(e), 0)
		}
	}, s.getTeamMsgReadAccounts = function(e) {
		if (e.error) return void this.logger.error("team::getTeamMsgReadAccounts: ", e.error);
		const t = r._get(e, "content.readAccounts") || [],
			n = r._get(e, "content.unreadAccounts") || [],
			s = r._get(e, "content.teamMsgReceipt.idClient") || [];
		this.db.putMsgReadDetail({
			idClient: s,
			readAccounts: t,
			unreadAccounts: n
		})
	}, s.sendTeamMsgReceipt = function(e) {
		if (e.error) return void this.logger.error("team::sendTeamMsgReceipt: ", e.error);
		const t = r._get(e, "obj.teamMsgReceipts") || [],
			n = r._get(e, "content.teamMsgReceipts") || [];
		if (this.db.enable) {
			const e = [];
			t.forEach(t => {
				n.some(e => t.idServer === e.idServer) || e.push({
					idClient: t.idClient,
					hasRead: !0
				})
			}), e.length > 0 && (this.logger.log("sendTeamMsgReceipt::updateMsgBatch"), setTimeout(
			() => this.db.updateMsgBatch(e), 0))
		}
	}, s.onCreateTeam = function(e, t) {
		var n = this.db;
		n.enable && (n.putTeam(e), n.putTeamMembers(t));
		try {
			this.options.onCreateTeam(e, t)
		} catch (e) {
			throw this.logger.error("userOption:onCreateTeam function error", e), e
		}
	}, s.onTeams = function(e) {
		e.content = e.content || {};
		var t, n = this,
			s = n.db,
			r = n.packetFromSync(e),
			i = e.content.teams || [],
			c = !0,
			m = [],
			u = [];
		if (e.error) switch (e.error.code) {
			case 803:
				e.error = null, c = !1
		}
		var l = new Promise((function(o, l) {
			var p, g;
			e.error ? r && l(e.error) : (! function() {
				c && i.forEach((function(e) {
					(e = a.reverse(e)).validToCurrentUser ? m.push(e) :
						u.push(e)
				}));
				i.length ? (c = !0, t = e.content.timetag) : c = !1
			}(), s.enable ? (p = o, g = l, e.promise = new Promise((function(e, i) {
				function o() {
					r ? (d(), e(), p()) : s.getTeams().then((function(
					t) {
						m = t, d(), e(), p()
					})).catch((function(e) {
						e.message = "db.getTeams error", e
							.callFunc =
							"team::afterMergeData", i(e), g(
								e)
					}))
				}
				c ? s.mergeTeams(m, u, t).then((function() {
					o()
				})).catch((function(e) {
					let t = {
						callFunc: "team::onTeams:mergeData",
						message: "db.mergeTeams error",
						event: e
					};
					i(t), g(t)
				})) : (n.logger.warn(
					"team::onTeams:mergeData: no teams need merge"
					), o())
			})).then(void 0, (function(e) {
				throw e.message = "merge teams data error", e.callFunc =
					"team::mergeData", g(e), e
			}))) : (d(), o()))
		})).catch(e => (n.logger.error("team::onTeams: ", e), Promise.reject(e)));

		function d() {
			n.timetags.teams = t, m.invalid = u, r ? (n.syncResult.teams = m, n.syncResult
				.invalidTeams = u, n.syncing || n.onSyncDone()) : (n.logger.info(
				"team::onTeams: not in syncing, get teams", o(m)), e.obj = m)
		}
		r && (l.cmd = "teams", n.syncPromiseArray.push(l))
	}, s.getTeamsById = function(e) {
		if (e.error) {
			if (816 !== e.error.code) return;
			this.logger.error("team::getTeamsById: ", e.error), e.error = null
		}
		e.content.teams = e.content.teams.map(e => a.reverse(e)), e.obj = e.content
	}, s.onTeamMembers = function(e) {
		e.content = e.content || {};
		var t, n, s = this,
			r = (s.db, s.packetFromSync(e)),
			o = e.content.members || [],
			a = !0,
			m = [],
			u = [];
		if (e.obj && (n = e.obj.teamId), n || (n = e.content.teamId), n = "" + n, e.error) switch (e
			.error.code) {
			case 406:
				e.error = null, a = !1
		}
		var l = new Promise((function(l, d) {
			e.error ? r && (s.logger.error("team::onTeamMember: team error:", n, e.error),
				d({
					callFunc: "team::onTeamMembers",
					event: e.error,
					message: `teamId-${n} 获取群成员错误`
				})) : (! function() {
				a && o.forEach((function(e) {
					(e = c.reverse(e)).valid ? m.push(e) : u.push(e)
				}));
				o.length ? (a = !0, t = e.content.timetag) : a = !1
			}(), m.invalid = u, r ? (s.syncTeamMembersResult[n] = m, s
				.syncTeamMembersResult[n + "-invalid"] = u, s.timetags["team-" +
				n] = t) : (s.logger.info(
					"team::onTeamMembers: not syncing, get members", n, i(m)), e
				.obj = {
					teamId: n,
					members: m
				}), l())
		}));
		r && (l.cmd = n, s.syncTeamMembersPromiseArray.push(l))
	}, s.onUpdateTeamMember = function(e) {
		e.updateTime || (e.updateTime = +new Date), this.logger.info("team::onUpdateTeamMember: ", e &&
			e.account);
		try {
			this.options.onupdateteammember(r.simpleClone(e))
		} catch (e) {
			throw this.logger.error("userOption:onupdateteammember function error", e), e
		}
		var t = {
			teamId: e.teamId,
			memberUpdateTime: e.updateTime
		};
		this.onUpdateTeam(t);
		var n = this.db;
		n.enable && n.updateTeamMember(e)
	}, s.onUpdateTeam = function(e) {
		this.logger.info("team::onUpdateTeam:", e && e.teamId);
		try {
			this.options.onUpdateTeam(r.simpleClone(e))
		} catch (e) {
			throw this.logger.error("userOption:onUpdateTeam function error", e), e
		}
		var t = this.db;
		t.enable && t.updateTeam(e)
	}, s.onSyncMyTeamMembers = function(e) {
		var t = this,
			n = t.db,
			s = c.reverseMembers(e.content.teamMembers);
		if (n.enable) {
			var r = n.putTeamMembers(s).then((function() {
				return n.updateMyTeamMembersTimetag(e.content.timetag)
			})).catch(e => (t.logger.error("team::syncMyTeamMember: ", e), Promise.reject(e)));
			r.cmd = "myTeamMembers", t.syncTeamMembersPromiseArray.push(r)
		}
		t.mergeMyTeamMembers(s)
	}, s.mergeMyTeamMembers = function(e) {
		r.isArray(e) || (e = [e]);
		var t = this.myTeamMembersMap = this.myTeamMembersMap || {};
		e.forEach((function(e) {
			var n = e.teamId;
			t[n] = r.merge(t[n], e)
		}))
	}, s.notifyForNewTeamMsg = function(e) {
		r.isArray(e) || (e = [e]);
		var t = this,
			n = this.myTeamMembersMap || {},
			s = {},
			i = [];
		e.forEach((function(e) {
			r.exist(n[e]) ? s[e] = n[e].muteNotiType : i.push(e)
		}));
		var o = Promise.resolve({
			map: s
		});
		return i.length && (o = t.api.getMyTeamMembers({
			teamIds: i,
			promise: !0
		}).then((function(n) {
			t.mergeMyTeamMembers(n), n.forEach((function(e) {
				s[e.teamId] = e.muteNotiType
			}));
			var r = e.filter(e => !s[e]);
			return Promise.resolve({
				map: s,
				miss: r
			})
		})).catch(e => Object.keys(s).length > 0 ? Promise.resolve({
			map: s,
			miss: i,
			error: e
		}) : Promise.reject(e))), o
	}, s.updateTeamSysMsgState = function(e, t) {
		var n, s = e.error;
		s && (t = "error", s = r.filterObj(s, "code message")), n = {
			idServer: e.obj.idServer,
			state: t
		}, s && (n.error = s), this.updateSysMsg(n)
	}, s.onTeamMsgReceipt = function(e) {
		const t = e.content;
		var n = e.error;
		if (n && this.logger.error("team::onTeamMsgReceipt:", n), t && t.teamMsgReceipts) try {
			this.options.onTeamMsgReceipt(t)
		} catch (n) {
			throw this.logger.error("userOption:onTeamMsgReceipt function error", n), n
		}
	}
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(0),
		i = (r.objs2accounts, r.teams2ids),
		o = n(50),
		a = n(29);
	s.processSuperTeam = function(e) {
		var t, n, s, r = e.error;
		switch (void 0 === e.obj && (e.obj = {}), e.cmd) {
			case "sendSuperTeamMsg":
				this.onSendMsg(e);
				break;
			case "superTeamMsg":
				this.onMsg(e);
				break;
			case "sendSuperTeamCustomSysMsg":
				this.onSendSysMsg(e);
				break;
			case "superTeamCustomSysMsg":
				this.onSysMsg(e);
				break;
			case "syncSuperTeams":
				this.onSuperTeams(e);
				break;
			case "syncCreateSuperTeam":
				t = o.reverse(e.content.team), s = a.assembleOwner(t), this.logger.info(
						"team::processTeam: sync createTeam", t && t.teamId, s && s.account), this
					.options.onSyncCreateSuperTeam(t, s), this.onCreateSuperTeam(t, s);
				break;
			case "getSuperTeamHistoryMsgs":
			case "searchSuperTeamHistoryMsgs":
				this.onHistoryMsgs(e);
				break;
			case "syncSendSuperTeamMsg":
				this.onMsg(e);
				break;
			case "addSuperTeamMembers":
			case "removeSuperTeamMembers":
			case "leaveSuperTeam":
			case "addSuperTeamManagers":
			case "removeSuperTeamManagers":
			case "transferSuperTeam":
				break;
			case "updateInfoInSuperTeam":
				r || ((n = e.obj).account = this.account, n.id = a.genId(n.teamId, n.account), n = a
					.reverse(n), e.obj = n, this.onUpdateSuperTeamMember(n));
				break;
			case "updateNickInTeam":
				e.obj = a.reverse(e.obj);
				break;
			case "syncUpdateSuperTeamMember":
				n = a.reverse(e.content.teamMember), this.onUpdateSuperTeamMember(n);
				break;
			case "updateSuperTeam":
				e.obj = o.reverse(e.obj, !0);
				break;
			case "getSuperTeam":
				e.error || (e.obj = o.reverse(e.content.team));
				break;
			case "getSuperTeams":
				this.onSuperTeams(e);
				break;
			case "syncSuperTeamMembers":
				this.onSyncSuperTeamMembers(e);
				break;
			case "getSuperTeamMembers":
				e.error || this.onGetAllSuperTeamMembers(e);
				break;
			case "getSuperTeamMembersByJoinTime":
			case "getSuperTeamMembersByAccounts":
			case "getMutedSuperTeamMembers":
				e.error || this.onSuperTeamMembers(e);
				break;
			case "onDeleteSuperTeamMsg":
				this.onDeleteMsg(e);
				break;
			case "onSuperTeamMsgDelete":
			case "syncDeleteSuperTeamMsg":
				this.onMsgDeleted(e, !0);
				break;
			case "onMarkSuperTeamSessionAck":
				this.onMarkSessionAck(e);
				break;
			case "syncMarkSuperTeamSessionAck":
				this.syncMarkSessionAck(e)
		}
	}, s.onSuperTeams = function(e) {
		e.content = e.content || {};
		var t, n = this,
			s = n.db,
			r = n.packetFromSync(e),
			a = e.content.teams || [],
			c = !0,
			m = [],
			u = [];
		if (e.error) switch (e.error.code) {
			case 803:
				e.error = null, c = !1
		}
		var l = new Promise((function(i, l) {
			var p, g;
			e.error ? r && l(e.error) : (! function() {
				c && a.forEach((function(e) {
					(e = o.reverse(e)).validToCurrentUser ? m.push(e) :
						u.push(e)
				}));
				a.length ? (c = !0, t = e.content.timetag) : c = !1
			}(), s.enable ? (p = i, g = l, e.promise = new Promise((function(e, i) {
				function o() {
					r ? (d(), e(), p()) : s.getSuperTeams().then((
						function(t) {
							m = t, d(), e(), p()
						})).then(void 0, (function(e) {
						e.message =
							"db.getSuperTeams error", e
							.callFunc =
							"superTeam::afterMergeData", i(
								e), g(e)
					}))
				}
				c ? s.mergeSuperTeams(m, u, t).then((function() {
					o()
				})).then(void 0, (function(e) {
					let t = {
						callFunc: "superTeam::onSuperTeams:mergeData",
						message: "db.mergeSuperTeams error",
						event: e
					};
					i(t), g(t)
				})) : (n.logger.warn(
					"superTeam::onSuperTeams:mergeData: no teams need merge"
					), o())
			})).then(void 0, (function(e) {
				throw e.message = "merge teams data error", e.callFunc =
					"superTeam::mergeData", g(e), e
			}))) : (d(), i()))
		})).catch(e => (n.logger.error("superTeam::onSuperTeams: ", e), Promise.reject(e)));

		function d() {
			n.timetags.superTeams = t, m.invalid = u, r ? (n.syncResult.superTeams = m, n.syncResult
				.invalidSuperTeams = u) : (n.logger.info(
				"superTeam::onSuperTeams: not in syncing, get teams", i(m)), e.obj = m)
		}
		r && (l.cmd = "superteams", n.syncPromiseArray.push(l))
	}, s.onCreateSuperTeam = function(e, t) {
		var n = this.db;
		n.enable && (n.putSuperTeam(e), n.putSuperTeamMembers(t))
	}, s.onGetAllSuperTeamMembers = function(e) {
		var t = this,
			n = this.db,
			s = e.raw.ser,
			r = this.superTeamMembersData[s] || {},
			i = r.teamId || e.obj && e.obj.teamId;
		if (n.enable) {
			let s = e.content && e.content.timetag,
				o = 200 === e.raw.code ? Promise.all(r.pArr) : Promise.resolve();
			e.promise = o.then(() => n.getSuperTeamMembers(i).then(t => {
				s && n.updateSuperTeamMemberTimetag(i, s), e.obj = {
					members: t,
					invalid: [],
					teamId: i
				}
			})).catch(e => t.logger.error(e))
		} else e.obj = {
			members: r.members,
			invalid: r.invalid,
			teamId: i
		};
		this.superTeamMembersData[s] = void 0
	}, s.onSyncSuperTeamMembers = function(e) {
		var t, n = this.db,
			s = [],
			r = [],
			i = e.content.members || [],
			o = e.raw.ser;
		if (e.obj && (t = e.obj.teamId), t || (t = e.content.teamId), i.forEach((function(e) {
				(e = a.reverse(e)).valid ? r.push(e) : s.push(e)
			})), n.enable) {
			this.superTeamMembersData[o] = this.superTeamMembersData[o] || {
				teamId: t,
				pArr: []
			};
			let i = Promise.resolve();
			e.content && e.content.isAll && (i = n.deleteSuperTeamMembers(t));
			let a = i.then(() => n.mergeSuperTeamMembers(t, r, s)).then(() => Promise.resolve());
			this.superTeamMembersData[o].pArr.push(a)
		} else this.superTeamMembersData[o] = this.superTeamMembersData[o] || {
			teamId: t,
			members: [],
			invalid: []
		}, r.length && (this.superTeamMembersData[o].members = this.api.mergeTeamMembers(this
			.superTeamMembersData[o].members, r)), s.length && (this.superTeamMembersData[o]
			.invalid = this.api.mergeTeamMembers(this.superTeamMembersData[o].invalid, s));
		e.raw = void 0
	}, s.onSuperTeamMembers = function(e, t) {
		var n, s = this.db,
			r = [],
			i = [];
		(e.content.members || []).forEach((function(e) {
				(e = a.reverse(e)).valid ? i.push(e) : r.push(e)
			})), e.obj && (n = e.obj.teamId), n || (n = e.content.teamId || i[0] && i[0].teamId), s
			.enable && !t && s.mergeSuperTeamMembers(n, i, r), e.obj = {
				members: i,
				invalid: r,
				teamId: n
			}
	}, s.onUpdateSuperTeamMember = function(e) {
		e.updateTime || (e.updateTime = +new Date), this.logger.info(
			"superTeam::onUpdateSuperTeamMember: ", e && e.account);
		try {
			this.options.onUpdateSuperTeamMember(r.simpleClone(e))
		} catch (e) {
			throw this.logger.error("userOption:onUpdateSuperTeamMember function error", e), e
		}
		var t = {
			teamId: e.teamId,
			memberUpdateTime: e.updateTime
		};
		this.onUpdateSuperTeam(t);
		var n = this.db;
		n.enable && n.updateSuperTeamMember(e)
	}, s.onUpdateSuperTeam = function(e) {
		this.logger.info("superteam::onUpdateSuperTeam:", e && e.teamId);
		try {
			this.options.onUpdateSuperTeam(r.simpleClone(e))
		} catch (e) {
			throw this.logger.error("userOption:onUpdateSuperTeam function error", e), e
		}
		var t = this.db;
		t.enable && t.updateSuperTeam(e)
	}
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(0),
		i = n(51);
	s.processNotify = function(e) {
		switch (e.cmd) {
			case "syncOfflineNetcallMsgs":
			case "syncOfflineMsgs":
				this.onOfflineMsgs(e);
				break;
			case "batchMarkRead":
				break;
			case "syncOfflineSysMsgs":
			case "syncOfflineSuperTeamSysMsgs":
				this.onOfflineSysMsgs(e);
				break;
			case "syncRoamingMsgs":
			case "syncSuperTeamRoamingMsgs":
				this.onRoamingMsgs(e);
				break;
			case "syncOfflineFilterMsgs":
				this.onOfflineMsgs(e, !0);
				break;
			case "syncOfflineFilterSysMsgs":
				this.onOfflineSysMsgs(e, !0);
				break;
			case "syncMsgReceipts":
				this.onOfflineMsgReceipts(e);
				break;
			case "syncDonnop":
				this.onDonnop(e, !0);
				break;
			case "syncSessionAck":
				this.syncSessionAck(e);
				break;
			case "syncSuperTeamSessionAck":
				this.syncSuperTeamSessionAck(e);
				break;
			case "syncRobots":
				this.onRobots(e);
				break;
			case "syncBroadcastMsgs":
				this.onBroadcastMsgs(e);
				break;
			case "syncDeleteSuperTeamMsgOfflineRoaming":
				this.onDeleteMsgOfflineRoaming(e);
				break;
			case "syncDeleteMsgSelf":
				this.syncDeleteMsgSelf(e);
				break;
			case "syncSessionsWithMoreRoaming":
				this.syncSessionsWithMoreRoaming(e);
				break;
			case "syncStickTopSessions":
				this.syncStickTopSessions(e);
				break;
			case "syncSessionHistoryMsgsDelete":
				this.syncSessionHistoryMsgsDelete(e)
		}
	}, s.onDonnop = function(e, t) {
		if (!e.error) {
			var n = this,
				s = n.db,
				r = i.reverse(e.content.donnop);
			n.mergeDonnop(r);
			var o = n.dbDonnop();
			if (t) {
				var a = e.content.timetag;
				n.timetags.donnop = a, s.enable && (o = o.then((function() {
						return n.db.updateDonnopTimetag(a)
					})).catch(e => (n.logger.error("notify::onDonnop: ", e), Promise.reject(e)))), o
					.cmd = "donnop", n.syncPromiseArray.push(o)
			} else n.onPushNotificationMultiportConfigUpdate()
		}
	}, s.onUpdateDonnop = function(e) {
		if (!e.error) {
			var t = e.obj;
			t && (this.mergeDonnop(r.filterObj(t, ["shouldPushNotificationWhenPCOnline"])), this
				.dbDonnop(), this.onPushNotificationMultiportConfigUpdate())
		}
	}, s.getPushNotificationMultiportConfig = function() {
		return r.merge({}, this.pushNotificationMultiportConfig)
	}, s.mergeDonnop = function(e) {
		this.pushNotificationMultiportConfig = r.merge({}, this.pushNotificationMultiportConfig, e)
	}, s.dbDonnop = function() {
		return this.db.enable ? this.db.setDonnop(this.pushNotificationMultiportConfig) : Promise
			.resolve()
	}, s.onPushNotificationMultiportConfigUpdate = function() {
		var e = this;
		setTimeout((function() {
			var t = e.getPushNotificationMultiportConfig();
			e.logger.info("link::onPushNotificationMultiportConfigUpdate:", t);
			try {
				e.options.onPushNotificationMultiportConfigUpdate(t)
			} catch (t) {
				throw e.logger.error(
					"userOption:onPushNotificationMultiportConfigUpdate function error",
					t), t
			}
		}))
	}
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(0),
		i = r.undef,
		o = n(5),
		a = n(20),
		c = n(29),
		m = n(27),
		u = (n(52), n(9)),
		l = n(1),
		d = n(11);

	function p(e, t, n) {
		var s = this,
			r = s.message.Message,
			i = n ? "offlineFilterMsgs" : "offlineMsgs";
		if (!(t && t.length > 0)) return Promise.resolve();
		var o = r.getMaxTimetag(t),
			a = t[0].scene,
			c = t[0].target;
		s.markMsgRead(t), t = r.sortMsgs(t), t = r.deduplication(t);
		var m = s.genSessionByMsgs(t);
		s.cacheSyncedSession(m);
		var u = s.putMsg(t, "offlineMsgs").then((function(t) {
			let n = t;
			n = s.filterIgnore(n), n.length && (s.logger.info(
					"msg::onOfflineMsgs： toreLastSession", i, e, n.length), s.syncResult[
				i] = s.syncResult[i] || [], s.syncResult[i].push({
					sessionId: e,
					scene: a,
					to: c,
					msgs: n,
					timetag: o
				}))
		})).catch(e => (s.logger.error("msg::onOfflineMsgs: ", e), Promise.reject(e)));
		return u.cmd = "offlineMsgs-" + e, u
	}
	s.processMsg = function(e) {
		switch (e.cmd) {
			case "sendMsg":
				this.onSendMsg(e);
				break;
			case "msg":
				this.onMsg(e);
				break;
			case "sysMsg":
				this.onSysMsg(e);
				break;
			case "broadcastMsg":
				this.onBroadcastMsg(e);
				break;
			case "sendCustomSysMsg":
				this.onSendSysMsg(e);
				break;
			case "getHistoryMsgs":
			case "searchHistoryMsgs":
				this.onHistoryMsgs(e);
				break;
			case "msgFtsInServer":
			case "msgFtsInServerByTiming":
				this.onmsgFtsInServer(e);
				break;
			case "syncSendMsg":
				this.onMsg(e);
				break;
			case "deleteSessions":
				this.onDeleteSessions(e);
				break;
			case "sendMsgReceipt":
				this.onSendMsgReceipt(e);
				break;
			case "msgReceipt":
				this.onMsgReceipt(e);
				break;
			case "onDeleteMsg":
				this.onDeleteMsg(e);
				break;
			case "onMsgDeleted":
				this.onMsgDeleted(e);
				break;
			case "onDeleteMsgOfflineRoaming":
				this.onDeleteMsgOfflineRoaming(e);
				break;
			case "onMarkSessionAck":
				this.onMarkSessionAck(e);
				break;
			case "syncMarkSessionAck":
				this.syncMarkSessionAck(e);
				break;
			case "syncUpdateServerSession":
				this.onSyncUpdateServerSession(e);
				break;
			case "deleteMsgSelf":
				this.deleteMsgSelf(e);
				break;
			case "deleteMsgSelfBatch":
				this.deleteMsgSelfBatch(e);
				break;
			case "onDeleteMsgSelf":
				this.onDeleteMsgSelf(e);
				break;
			case "onDeleteMsgSelfBatch":
				this.onDeleteMsgSelfBatch(e);
				break;
			case "clearServerHistoryMsgs":
				this.clearServerHistoryMsgs(e);
				break;
			case "onClearServerHistoryMsgs":
				this.onClearServerHistoryMsgs(e)
		}
	}, s.checkIgnore = function(e) {
		var t = this;
		e.forEach((function(e) {
			if (!e.ignore) {
				try {
					t.options.shouldIgnoreMsg(e) && (e.ignore = !0)
				} catch (e) {
					throw t.logger.error("userOption:shouldIgnoreMsg function error", e), e
				}
				var n;
				try {
					n = t.options.shouldIgnoreNotification(e)
				} catch (e) {
					throw t.logger.error(
						"userOption:shouldIgnoreNotification function error", e), e
				}
				"notification" === e.type && n && (e.ignore = !0)
			}
		}))
	}, s.filterIgnore = function(e) {
		return e.filter((function(e) {
			return !e.ignore
		}))
	}, s.genSessionByMsgs = function(e) {
		return this.checkIgnore(e), m.genSessionByMsgs(this.message.Message, e)
	}, s.onRoamingMsgs = function(e) {
		var t = this,
			n = t.message,
			s = n.Message,
			r = s.getMaxTimetag,
			i = n.reverseMsgs(e.content.msgs),
			o = r(i);
		i = s.sortMsgs(i);
		var a = (i = s.deduplication(i))[0],
			c = a.sessionId,
			m = t.genSessionByMsgs(i);
		t.cacheSyncedSession(m);
		var u = t.putMsg(i, "roamingMsgs").then((function(e) {
			i = e, (i = t.filterIgnore(i)).length && (t.logger.info(
					"msg::onRoamingMsgs: putRoamingMsgs", c, i.length), t.syncResult
				.roamingMsgs = t.syncResult.roamingMsgs || [], t.syncResult.roamingMsgs
				.push({
					sessionId: c,
					scene: a.scene,
					to: a.target,
					msgs: i,
					timetag: o
				}), t.syncing || t.onSyncDone())
		})).catch(e => (t.logger.error("msg::onRoamingMsgs: ", e), Promise.reject(e)));
		u.cmd = "roamingMsgs-" + c, t.syncPromiseArray.push(u)
	}, s.onOfflineMsgs = function(e, t) {
		var n = this.message,
			s = null;
		t && (s = {
			filter: !0
		});
		var i = n.reverseMsgs(e.content.msgs, {
				modifyObj: s
			}),
			o = {};
		i.forEach((function(e) {
			o[e.sessionId] = o[e.sessionId] || [], o[e.sessionId].push(e)
		}));
		var a = Object.keys(o).map(e => ({
			sessionId: e,
			msgs: o[e]
		}));
		const c = r.asyncPool(50, a, e => p.call(this, e.sessionId, e.msgs, t));
		this.syncPromiseArray.push(c)
	}, s.completeMsg = function(e) {
		return e.from = this.account, e.fromNick = this.myInfo && this.myInfo.nick, e.fromClientType =
			"Web", e.fromDeviceId = o.deviceId, e.time || (e.time = +new Date), e
	}, s.onMsgs = function(e) {
		var t = this,
			n = t.message.reverseMsgs(e.content.msgs, {
				mapper: function(e) {
					t.handleMsg(e)
				}
			});
		t.pushMsgDelay(n)
	}, s.onMsg = function(e, t) {
		var n = this.message.reverse(e.content.msg);
		t && (n.filter = !0), "syncSendMsg" !== e.cmd || n.from !== n.to ? (this.pushMsgDelay([n]), this
			.syncing ? (this.logger.info("msg::onMsg:is in syncing ..."), this.unhandledMsgs.push({
				type: "onMsg",
				msg: n
			})) : this.handleMsg(n)) : this.logger.warn("onMsg::syncSendMsg to self, so ignore", n
			.idClient, n.idServer)
	}, s.onBroadcastMsgs = function(e) {
		var t = e.content.broadcastMsgs;
		t = t.sort((function(e, t) {
			return e.broadcastId - t.broadcastId
		})), this.putBroadcastMsgs(t)
	}, s.onBroadcastMsg = function(e) {
		var t = e.content.broadcastMsg;
		t.time = t.timestamp, this.syncing ? this.unhandledMsgs.push({
			type: "onBroadcastMsg",
			msg: t
		}) : t && this.putBroadcastMsg(t)
	}, s.pushMsgTask = function(e) {
		this.msgPromise = this.msgPromise.then(() => e())
	}, s.pushMsgDelay = function(e) {
		if (e && e.length > 0) {
			var t = this;
			if (t.msgStatEnable && !l.isWeixinApp && void 0 !== t.relativeSeverTime) {
				var n = e.map(e => ({
					appkey: t.options.appKey,
					accid: e.to,
					fromAccid: e.from,
					msgId: e.idServer,
					serverTime: e.time,
					receiveTime: Date.now() - t.relativeSeverTime,
					sessionId: t.sdkSession,
					platform: "web",
					sdk_ver: l.info.version,
					manufactor: d.name + " " + d.version
				}));
				t.msgDelayArr = t.msgDelayArr.concat(n), t.msgDelayArr.length > 5 && t
				.doReportMsgDelay()
			}
		}
	}, s.doReportMsgDelay = function() {
		var e = JSON.stringify(this.msgDelayArr);
		this.msgDelayArr && this.msgDelayArr.length > 0 && (u.sendBeacon(
					"https://statistic.live.126.net/statics/report/im/sdk/msgreceived", e), this
				.msgDelayArr = []), this.msgDelayTimer && clearTimeout(this.msgDelayTimer), this
			.socket && (this.msgDelayTimer = setTimeout(this.doReportMsgDelay.bind(this), 1e4))
	}, s.handleMsg = function(e) {
		var t = this,
			n = t.db,
			s = e.time;
		t.markMsgRead(e), t.msgPromise = t.msgPromise.then((function() {
			return t.putMsg(e, "onMsg")
		})).then((function(r) {
			return t.logger.info(`msg::handleMsg:putMsg: done ${e.idServer} ${e.idClient}`),
				n.enable ? "superTeam" === e.scene ? n.updateSuperTeamRoamingMsgTimetag(s) :
				n.updateRoamingMsgTimetag(s) : (t.timetags["superTeam" === e.scene ?
					"superTeamRoamingMsgs" : "roamingMsgs"] = s, Promise.resolve())
		})).then((function() {
			if (e) return t.checkUserUpdate(e)
		})).then((function() {
			if (e) {
				var n = e.type;
				switch (t.logger.info("msg::handleMsg:checkUserUpdate: " + e.scene + " " +
					n + " msg" + ("notification" === n ? " " + e.attach.type : "")), n) {
					case "notification":
						return t.onTeamNotificationMsg(e)
				}
			}
		})).then((function() {
			e && !e.ignore && (t.logger.info("msg::handleMsg:onmsg: ", e.idClient, e
				.idServer), setTimeout((function() {
				try {
					t.options.onmsg(r.copy(e))
				} catch (e) {
					throw t.logger.error("userOption:onmsg function error",
						e), e
				}
			}), 0))
		})).catch((function(e) {
			e.callFunc = "msg::handleMsg", t.onCustomError("消息处理错误", e)
		}))
	}, s.putMsg = function(e, t) {
		if (r.isArray(e) || (e = [e]), e[0].filter) return Promise.resolve(e);
		var n, s = this,
			o = s.db,
			a = o.enable,
			c = Promise.resolve(),
			m = s.message.Message.getLastMsg(e),
			u = m.flow,
			l = s.genSessionByMsgs(e);
		p(l);
		var d = [];

		function p(e) {
			"roamingMsgs" !== t && "offlineMsgs" !== t || s.cacheSyncedSession(e)
		}
		return c = (c = (c = c.then((function() {
			return a || s.options.autoMarkRead || "roamingMsgs" === t || !l || (s
					.sessionUnreadMsgs = s.sessionUnreadMsgs || {}, s
					.sessionUnreadMsgs[l.id] = s.sessionUnreadMsgs[l.id] || [], s
					.sessionUnreadMsgs[l.id] = s.sessionUnreadMsgs[l.id].concat(e
						.filter(e => {
							try {
								return s.options.shouldCountNotifyUnread(e)
							} catch (e) {
								throw s.logger.error(
									"userOption:shouldCountNotifyUnread function error",
									e), e
							}
						}))), "offlineMsgs" === t || "roamingMsgs" === t ? Promise
				.reject(e) : a ? o.putMsg(e) : e
		})).then((function(t) {
			var n = [];
			return e.forEach((function(e) {
				s.checkMsgUnique(e) && n.push(e)
			})), e = n, d = a ? t : e, Promise.resolve(e)
		}))).then((function(e) {
			return e.length && a && l ? new Promise((t, n) => {
				o.getSessions({
					sessionId: l.id
				}).then((function(n) {
					if (n && n.lastMsg) {
						var s = n.lastMsg;
						l.lastMsg && l.lastMsg.time < s.time && (l
							.lastMsg = s)
					}
					d && d.length ? l ? o.putSession(l).then(e => {
						t(e)
					}) : t(n) : (d = e, t(n))
				}))
			}) : Promise.resolve(l)
		}))).then((function(e) {
			if (!l) return;
			if (!d.length) return;
			n = m.sessionId !== s.currSessionId;
			const c = "roamingMsgs" === t,
				g = s.options.syncSessionUnread,
				f = l.id,
				h = s.findSession(f) || {};
			let y = h.ack || 0;
			if ("offlineMsgs" === t || c && g || "onMsg" === t && "in" === u && n) {
				if (a && e) {
					const t = h.unread || 0;
					(l = e).unread = t, y = y || l.ack || 0
				} else(e = h) && (l.unread = e.unread || 0);
				p(l), l.unread = l.unread || 0;
				var v = 0;
				d.forEach((function(e) {
					let t;
					try {
						t = s.options.shouldCountNotifyUnread(e)
					} catch (e) {
						throw s.logger.error(
							"userOption:shouldCountNotifyUnread function error",
							e), e
					}
					let n = ("notification" !== e.type || "notification" === e
						.type && t) && (i(e.isUnreadable) || e.isUnreadable);
					if (n && g && (n = e.time > y && "out" !== e.flow), n && (
							v++, g && !a)) {
						const t = h.unreadMsgs || [];
						t.push(e), l.unreadMsgs = t
					}
				})), l.unread += v;
				var b = r.secureOutput("session", l);
				if (b.unreadMsgs && (b.unreadMsgs = b.unreadMsgs.map(e => e && e.idServer)),
					s.logger.info("msg::putMsg:updateSession: ", b), p(l), a) return o
					.updateSession({
						id: l.id,
						unread: l.unread
					})
			}
		})), "onMsg" === t && (c = c.then((function() {
			e.length && l && (s.onUpdateSession(l), s.options.syncSessionUnread && !n &&
				s.api.resetSessionUnread(s.currSessionId))
		}))), c.then((function() {
			return Promise.resolve(e)
		})).catch(e => e && e.length ? Promise.resolve(e) : Promise.reject(e))
	}, s.putBroadcastMsgs = function(e) {
		var t = this,
			n = t.db;
		let s = e.length;
		if (s > 0) {
			if (t.doMarkBroadcastMsgsRead(e), n.enable) {
				let i = e[s - 1].broadcastId;
				return n.updateBroadcastMsgTimetag(i), n.putBroadcastMsg(e).then((function() {
					return setTimeout((function() {
						t.doMarkMsgsRead();
						try {
							t.options.onbroadcastmsgs(r.copy(e))
						} catch (e) {
							throw t.logger.error(
								"userOption:onbroadcastmsgs function error",
								e), e
						}
					}), 0), Promise.resolve(e)
				}))
			}
			setTimeout((function() {
				try {
					t.options.onbroadcastmsgs(r.copy(e))
				} catch (e) {
					throw t.logger.error("userOption:onbroadcastmsgs function error", e), e
				}
			}), 0)
		}
		return e
	}, s.putBroadcastMsg = function(e) {
		var t = this,
			n = t.db;
		return t.doMarkBroadcastMsgsRead([e]), n.enable ? (e.broadcastId && n.updateBroadcastMsgTimetag(
			e.broadcastId), n.putBroadcastMsg(e).then((function() {
			return setTimeout((function() {
				try {
					t.options.onbroadcastmsg(r.copy(e))
				} catch (e) {
					throw t.logger.error(
							"userOption:onbroadcastmsg function error", e),
						e
				}
			}), 0), Promise.resolve(e)
		}))) : (setTimeout((function() {
			try {
				t.options.onbroadcastmsg(r.copy(e))
			} catch (e) {
				throw t.logger.error("userOption:onbroadcastmsg function error", e), e
			}
		}), 0), e)
	}, s.doMarkBroadcastMsgsRead = function(e) {
		e = e.map(e => e.broadcastId), this.sendCmd("batchMarkRead", {
			sid: 7,
			cid: 17,
			ids: e
		})
	}, s.cacheSyncedSession = function(e) {
		if (e && this.syncResult) {
			e = Object.assign({}, e), this.syncResult.sessions = this.syncResult.sessions || {};
			var t = e.id,
				n = this.syncResult.sessions[t] || {};
			n && n.ack < e.ack && (e.ack = void 0), n && n.msgReceiptTime < e.msgReceiptTime && (e
				.msgReceiptTime = void 0);
			var s = r.get(n, "lastMsg.time"),
				i = r.get(e, "lastMsg.time");
			s && i && s > i && (e.lastMsg = n.lastMsg), this.syncResult.sessions[t] = Object.assign(n,
				e), this.syncResult.sessions[t] = Object.assign({}, this.mergeSession(this
				.syncResult.sessions[t]))
		}
	}, s.checkMsgUnique = r.genCheckUniqueFunc("idClient"), s.revokeMsgUniqueCheck = function(e) {
		this.uniqueSet && this.uniqueSet.idClient && (this.uniqueSet.idClient[e] = !1)
	}, s.storeSendMsg = function(e) {
		if (!this.syncing) {
			var t = this.putMsg(e, "sendMsg");
			return this.msgPromise = this.msgPromise.then((function() {
				return t
			})), t
		}
		this.unhandledMsgs.push({
			type: "sendMsg",
			msg: e
		})
	}, s.updateSendMsgError = function(e) {
		if (!this.syncing) {
			var t = this.updateMsg(e);
			return this.msgPromise = this.msgPromise.then((function() {
				return t
			})), t
		}
		this.unupdatedMsgs.push(e)
	}, s.onSendMsg = function(e, t) {
		var n = this,
			s = e.content && e.content.msg,
			r = e.obj && e.obj.msg || s;
		if (this.logger.warn(`sendMsg::end: ${s&&s.idServer} ${r.idClient}`), e.obj) o();
		else {
			var i = n.db;
			i && i.enable && i.getMsgByIdClient(r.idClient).then(e => {
				e && (r = e, o())
			}).catch(e => o())
		}

		function o() {
			n.completeMsg(r);
			var i = e.error && 7101 === e.error.code;
			e.error && !i || (r.idServer = s.idServer, r.time = +s.time, s.yidunAntiSpamRes && (r
					.yidunAntiSpamRes = s.yidunAntiSpamRes), s.callbackExt && (r.callbackExt = s
					.callbackExt)), i && (r.isInBlackList = !0), e.error ? r.status = "fail" : r
				.status = "success", r = n.message.reverse(r), t && (r.filter = !0), e.obj = r, n
				.syncing ? n.unupdatedMsgs.push(r) : n.msgPromise = Promise.all([n.msgPromise, e.obj
					.promise
				]).then((function(e) {
					return e.length || (r.resend = !0), n.updateMsg(r).then((function() {
						return n.options.syncSessionUnread && n.currSessionId === r
							.sessionId && n.api.resetSessionUnread(n.currSessionId),
							n.resolveMsgReceiptTask(r), r
					}))
				})).catch(e => {
					n.logger.error("onSendMsg::dealMsg error", e)
				})
		}
	}, s.updateLocalMsg = function(e) {
		var t = this.updateMsg(e);
		return this.msgPromise = this.msgPromise.then((function() {
			return t
		})), t
	}, s.updateMsg = function(e) {
		if (e.filter || this.options.shouldIgnoreMsg(e)) return Promise.resolve(e);
		var t = this,
			n = t.db,
			s = "success" === e.status,
			r = m.genSessionByMsg(e),
			i = !!e.isLocal;
		return t.onUpdateSession(r), n.enable ? n.updateMsg(e).then((function(t) {
			var o = n.updateSession(r),
				a = Promise.resolve();
			return s && t && !i && (a = "superTeam" === e.scene ? n
				.updateSuperTeamRoamingMsgTimetag(t.time) : n.updateRoamingMsgTimetag(t
					.time)), Promise.all([o, a])
		})).catch(e => {
			t.logger.error("updateMsg error", e)
		}) : (s && !i && (t.timetags.roamingMsgs = e.time), Promise.resolve(e))
	}, s.updateRoamingMsgTimetag = function(e) {
		var t = this.db;
		return t.enable ? t.updateRoamingMsgTimetag(e) : (this.timetags.roamingMsgs = e, Promise
			.resolve(e))
	}, s.checkUserUpdate = function(e) {
		var t = this,
			n = e.from;
		return t.logger.info("handleMsg::checkUserUpdate: ", n, t.account), n === t.account ? Promise
			.resolve() : new Promise((function(s) {
				var i = t.userSet[n];
				if (i) {
					var o = +i.updateTime,
						a = +e.userUpdateTime;
					!isNaN(o) && !isNaN(a) && r.isNumber(o) && r.isNumber(a) && o < a ? c() :
					s()
				} else c();

				function c() {
					t.api.getUser({
						account: n,
						sync: !0,
						done: function(e, n) {
							e || setTimeout((function() {
								t.logger.log(
									"user::checkUserUpdate: onupdateuser",
									n && n.account);
								try {
									t.options.onupdateuser(n)
								} catch (e) {
									throw t.logger.error(
										"userOption:onupdateuser function error",
										e), e
								}
							}), 0), s()
						}
					})
				}
			}))
	}, s.processUnsettledMsgs = function() {
		var e = this;
		e.unhandledMsgs.forEach((function(t) {
			var n = t.msg;
			switch (t.type) {
				case "onMsg":
					e.handleMsg(n);
					break;
				case "sendMsg":
					e.msgPromise = e.msgPromise.then((function() {
						return e.putMsg(n)
					}));
					break;
				case "onBroadcastMsg":
					e.msgPromise = e.msgPromise.then((function() {
						return e.putBroadcastMsg(n)
					}))
			}
		})), e.unupdatedMsgs.forEach((function(t) {
			e.msgPromise = e.msgPromise.then((function() {
				return e.updateMsg(t)
			}))
		})), e.resetUnsettledMsgs()
	}, s.onTeamNotificationMsg = function(e) {
		this.db;
		var t = e.attach,
			n = t.type,
			s = e.from,
			r = e.to,
			i = e.time,
			o = t.team,
			a = t.account,
			c = t.accounts;
		switch (n) {
			case "updateTeam":
				return o.updateTime = i, this.onUpdateTeam(o);
			case "addTeamMembers":
				return this.onAddTeamMembers(e, o, c);
			case "removeTeamMembers":
				return this.onRemoveTeamMembers(o, r, c);
			case "acceptTeamInvite":
				return this.onAddTeamMembers(e, o, [s]);
			case "passTeamApply":
				return this.onAddTeamMembers(e, o, [a]);
			case "addTeamManagers":
				return this.updateTeamManagers(e, r, c, !0, i);
			case "removeTeamManagers":
				return this.updateTeamManagers(e, r, c, !1, i);
			case "leaveTeam":
				return this.onRemoveTeamMembers(o, r, [s]);
			case "dismissTeam":
				return this.onDismissTeam(r, i);
			case "transferTeam":
				return this.transferTeam(e, o, s, a);
			case "updateTeamMute":
				return this.onUpdateTeamMembersMute(e, o, [a], t.mute);
			case "updateSuperTeam":
				return o.updateTime = i, this.onUpdateSuperTeam(o);
			case "addSuperTeamMembers":
				return this.onAddSuperTeamMembers(e, o, c);
			case "passSuperTeamApply":
				return this.onAddSuperTeamMembers(e, o, [a]);
			case "removeSuperTeamMembers":
				return this.onRemoveSuperTeamMembers(o, r, c);
			case "leaveSuperTeam":
				return this.onRemoveSuperTeamMembers(o, r, [s]);
			case "dismissSuperTeam":
				return this.onDismissSuperTeam(r, i);
			case "transferSuperTeam":
				return this.transferSuperTeam(e, o, s, a);
			case "addSuperTeamManagers":
				return this.updateSuperTeamManagers(e, r, c, !0, i);
			case "removeSuperTeamManagers":
				return this.updateSuperTeamManagers(e, r, c, !1, i);
			case "updateSuperTeamMembersMute":
				return this.onUpdateSuperTeamMembersMute(e, o, c, t.mute)
		}
	}, s.onAddSuperTeamMembers = function(e, t, n) {
		var s = this.db,
			i = c.assembleMembers(t, n);
		e.attach.members = i;
		var o = {
			team: t,
			accounts: n,
			members: i
		};
		this.logger.info(`team::onAddSuperTeamMembers: ${o.team.teamId}, `, o.accounts);
		try {
			this.options.onAddSuperTeamMembers(r.simpleClone(o))
		} catch (e) {
			throw this.logger.error("userOption:onAddSuperTeamMembers function error", e), e
		}
		if (s.enable) {
			var a = s.putSuperTeamMembers(i),
				m = s.putSuperTeam(t);
			return Promise.all([a, m])
		}
	}, s.onRemoveSuperTeamMembers = function(e, t, n) {
		var s = this.db,
			i = {
				team: e,
				accounts: n
			};
		this.logger.info(`team::onRemoveSuperTeamMembers: ${i.team.teamId}, `, i.accounts);
		try {
			this.options.onRemoveSuperTeamMembers && this.options.onRemoveSuperTeamMembers(r
				.simpleClone(i))
		} catch (e) {
			throw this.logger.error("userOption:onRemoveSuperTeamMembers function error", e), this
				.options.onerror && this.options.onerror(e), new Error(
					"Excute onRemoveSuperTeamMembers failed" + e.message)
		}
		if (s.enable) {
			if (-1 === n.indexOf(this.account)) {
				var o = s.removeSuperTeamMembersByAccounts(t, n),
					a = Promise.resolve();
				return e && (a = s.putSuperTeam(e)), Promise.all([o, a])
			}
			return s.leaveSuperTeam(t)
		}
	}, s.onDismissSuperTeam = function(e, t) {
		var n = this.db,
			s = {
				teamId: e
			};
		this.logger.info("team::onDismissSuperTeam:", e);
		try {
			this.options.onDismissSuperTeam(s)
		} catch (e) {
			throw this.logger.error("userOption:onDismissSuperTeam function error", e), e
		}
		if (n.enable) return n.dismissSuperTeam(e, t)
	}, s.onAddTeamMembers = function(e, t, n) {
		var s = this,
			i = s.db,
			o = t.teamId,
			c = a.assembleMembers(t, n);
		e.attach.members = c;
		var m = {
			team: t,
			accounts: n,
			members: c
		};
		s.logger.info("team::onAddTeamMembers: ", o, n);
		try {
			s.options.onAddTeamMembers(r.simpleClone(m))
		} catch (e) {
			throw s.logger.error("userOption:onAddTeamMembers function error", e), e
		}
		if (i.enable) {
			var u, l = i.putTeam(t);
			return -1 === n.indexOf(s.account) ? u = i.putTeamMembers(c) : (s.logger.log(
				"team::onAddTeamMembers: user join team", o), l = new Promise((function(e) {
				s.api.getTeamMembers({
					teamId: o,
					sync: !0,
					done: function() {
						e()
					}
				})
			}))), Promise.all([u, l])
		}
	}, s.onRemoveTeamMembers = function(e, t, n) {
		var s = this.db,
			i = {
				team: e,
				accounts: n
			};
		this.logger.info("team::onRemoveTeamMembers: " + e.teamId, n);
		try {
			this.options.onRemoveTeamMembers(r.simpleClone(i))
		} catch (e) {
			throw this.logger.error("userOption:onRemoveTeamMembers function error", e), e
		}
		if (s.enable) {
			if (-1 === n.indexOf(this.account)) {
				var o = s.removeTeamMembersByAccounts(t, n),
					a = Promise.resolve();
				return e && (a = s.putTeam(e)), Promise.all([o, a])
			}
			return s.leaveTeam(t)
		}
	}, s.updateTeamManagers = function(e, t, n, s, i) {
		var o = this.db,
			c = e.attach.members = n.map((function(e) {
				return {
					id: a.genId(t, e),
					type: s ? "manager" : "normal",
					updateTime: i
				}
			})),
			m = {
				teamId: "" + t,
				memberUpdateTime: i
			};
		e.attach.team = m;
		var u = {
			team: m,
			accounts: n,
			isManager: s,
			members: c
		};
		this.logger.info("team::updateTeamManagers:", t, n, s);
		try {
			this.options.onUpdateTeamManagers(r.simpleClone(u))
		} catch (e) {
			throw this.logger.error("userOption:onUpdateTeamManagers function error", e), e
		}
		if (o.enable) {
			var l = o.updateTeam(m),
				d = o.updateTeamManagers(t, n, s, i);
			return Promise.all([l, d])
		}
	}, s.updateSuperTeamManagers = function(e, t, n, s, i) {
		var o = this.db,
			c = e.attach.members = n.map((function(e) {
				return {
					id: a.genId(t, e),
					teamId: t,
					account: e,
					type: s ? "manager" : "normal",
					updateTime: i
				}
			})),
			m = {
				teamId: "" + t,
				memberUpdateTime: i
			};
		e.attach.team = m;
		var u = {
			team: m,
			accounts: n,
			isManager: s,
			members: c
		};
		this.logger.info("team::updateSuperTeamManagers:", t, n, s);
		try {
			this.options.onUpdateSuperTeamManagers(r.simpleClone(u))
		} catch (e) {
			throw this.logger.error("userOption:onUpdateSuperTeamManagers function error", e), e
		}
		if (o.enable) {
			var l = o.updateSuperTeam(m),
				d = o.updateSuperTeamMembers(c);
			return Promise.all([l, d])
		}
	}, s.onDismissTeam = function(e, t) {
		var n = this.db,
			s = {
				teamId: e
			};
		this.logger.info("team::onDismissTeam:", e);
		try {
			this.options.onDismissTeam(s)
		} catch (e) {
			throw this.logger.error("userOption:onDismissTeam function error", e), e
		}
		if (n.enable) return n.dismissTeam(e, t)
	}, s.transferTeam = function(e, t, n, s) {
		var i = this.db,
			o = t.teamId,
			c = t.memberUpdateTime,
			m = {
				id: a.genId(o, n),
				type: "normal",
				updateTime: c
			},
			u = {
				id: a.genId(o, s),
				type: "owner",
				updateTime: c
			};
		e.attach.members = [m, u];
		var l = {
			team: t,
			from: m,
			to: u
		};
		this.logger.info("team::transferTeam: from to", o, n, s);
		try {
			this.options.onTransferTeam(r.simpleClone(l))
		} catch (e) {
			throw this.logger.error("userOption:onTransferTeam function error", e), e
		}
		if (i.enable) return i.transferTeam(t, n, s)
	}, s.transferSuperTeam = function(e, t, n, s) {
		var i = this.db,
			o = t.teamId,
			a = t.memberUpdateTime,
			c = {
				teamId: o,
				type: "normal",
				account: n,
				updateTime: a
			},
			m = {
				teamId: o,
				type: "owner",
				account: s,
				updateTime: a
			};
		e.attach.members = [c, m];
		var u = {
			team: t,
			from: c,
			to: m
		};
		this.logger.info("team::transferSuperTeam: from to ", o, n, s);
		try {
			this.options.onTransferSuperTeam(r.simpleClone(u))
		} catch (e) {
			throw this.logger.error("userOption:onTransferSuperTeam function error", e), e
		}
		if (i.enable) return i.transferSuperTeam(t, c, m)
	}, s.onUpdateTeamMembersMute = function(e, t, n, s) {
		var i = this.db,
			o = n.map((function(e) {
				return {
					id: a.genId(t.teamId, e),
					account: e,
					teamId: t.teamId,
					mute: s,
					updateTime: t.memberUpdateTime
				}
			}));
		e.attach.members = o;
		var c = {
			team: t,
			accounts: n,
			members: o,
			mute: s
		};
		this.logger.info("team::onUpdateTeamMembersMute:", t.teamId, n, s);
		try {
			this.options.onUpdateTeamMembersMute(r.simpleClone(c))
		} catch (e) {
			throw this.logger.error("userOption:onUpdateTeamMembersMute function error", e), e
		}
		if (i.enable) {
			var m = i.updateTeamMembers(o),
				u = i.putTeam(t);
			return Promise.all([m, u])
		}
	}, s.onUpdateSuperTeamMembersMute = function(e, t, n, s) {
		var i = this.db,
			o = n.map((function(e) {
				return {
					id: c.genId(t.teamId, e),
					account: e,
					teamId: t.teamId,
					mute: s,
					updateTime: t.memberUpdateTime
				}
			}));
		e.attach.members = o;
		var a = {
			team: t,
			accounts: n,
			members: o,
			mute: s
		};
		this.logger.info("team::onUpdateSuperTeamMembersMute:", t.teamId, n, s);
		try {
			this.options.onUpdateSuperTeamMembersMute(r.simpleClone(a))
		} catch (e) {
			throw this.logger.error("userOption:onUpdateSuperTeamMembersMute function error", e), e
		}
		if (i.enable) {
			var m = i.updateSuperTeamMembers(o),
				u = i.putSuperTeam(t);
			return Promise.all([m, u])
		}
	}, s.onHistoryMsgs = function(e) {
		e.error || (e.obj.msgs = this.message.reverseMsgs(e.content.msgs))
	}, s.onmsgFtsInServer = function(e) {
		if (!e.error) {
			const t = this.message.reverseMsgs(e.content.msgs);
			e.obj.msgs = t, e.content.msgs = t
		}
	}, s.isFilterMsgs = function(e) {
		return !!e[0].filter
	}, s.splitMsgs = function(e, t, n, s) {
		e.forEach((function(e) {
			if (e.filter) s.push(e);
			else switch (e.scene) {
				case "p2p":
					t.push(e);
					break;
				case "team":
					n.push(e)
			}
		}))
	}, s.markMsgRead = function(e, t) {
		r.isArray(e) || (e = [e]);
		if (this.db.enable || this.options.autoMarkRead || t) {
			const t = e.map(e => ({
				flag: "msg",
				idServer: e.idServer,
				scene: e.scene,
				filter: e.filter,
				type: e.type,
				attachType: e.attach && e.attach.type
			}));
			this.msgAckBufferManager.add(t)
		}
	}, s.markSysMsgRead = function(e, t) {
		r.isArray(e) || (e = [e]);
		if (this.db.enable || this.options.autoMarkRead || t) {
			const t = e.map(e => ({
				flag: "systemMsg",
				idServer: e.idServer,
				scene: e.scene,
				filter: e.filter,
				type: e.type
			}));
			this.msgAckBufferManager.add(t)
		}
	}, s.handleMsgsAck = function(e) {
		const t = {
			p2pSysMsgs: {
				sid: 7,
				cid: 3,
				msgs: []
			},
			p2pMsgs: {
				sid: 7,
				cid: 2,
				msgs: []
			},
			superTeamSysMsgs: {
				sid: 21,
				cid: 19,
				msgs: []
			},
			teamMsgs: {
				sid: 8,
				cid: 3,
				msgs: []
			},
			filterSysMsgs: {
				sid: 101,
				cid: 3,
				msgs: []
			},
			filterMsgs: {
				sid: 101,
				cid: 2,
				msgs: []
			},
			netcallMsgs: {
				sid: 9,
				cid: 11,
				msgs: []
			}
		};
		e.forEach(e => {
			/^(netcallBill|netcallMiss|netcallReject)$/.test(e.attachType) ? t.netcallMsgs.msgs
				.push(e) : e.filter ? "systemMsg" === e.flag ? t.filterSysMsgs.msgs.push(e) : t
				.filterMsgs.msgs.push(e) : "systemMsg" !== e.flag ? "p2p" === e.scene ? t
				.p2pMsgs.msgs.push(e) : "team" === e.scene && t.teamMsgs.msgs.push(e) :
				"superTeam" === e.scene ? t.superTeamSysMsgs.msgs.push(e) : t.p2pSysMsgs.msgs
				.push(e)
		}), Object.keys(t).forEach(e => this.doMarkMsgsRead(t[e].sid, t[e].cid, t[e].msgs))
	}, s.doMarkMsgsRead = function(e, t, n) {
		n && n.length && (this.logger.log("markMsgRead::batchMarkRead", e, t, n), this.sendCmd(
			"batchMarkRead", {
				sid: e,
				cid: t,
				ids: n.map((function(e) {
					return e.idServer
				}))
			}))
	}
}, function(e, t, n) {
	var s = n(2).fn,
		r = (n(0), n(94)),
		i = n(95);

	function o(e, t, n) {
		var s = this.timetags && this.timetags.sync;
		this.db.enable && s && t && this.db.getMsgByIdClient(e).then(e => {
			if (!e) return;
			if (e.commentTimetag && e.commentTimetag <= s && e.time <= s) return;
			if (e.commentTimetag = t.time, e.comments = e.comments || [], n) e.comments = e.comments
				.filter(e => e.body !== t.body || e.from !== t.from);
			else {
				let n;
				for (let s = 0; s < e.comments.length; s++)
					if (e.comments[s].from === t.from && e.comments[s].body === t.body) {
						e.comments[s] = t, n = !0;
						break
					} n || e.comments.push(t)
			}
			const r = {
				idClient: e.idClient,
				comments: e.comments,
				commentTimetag: e.commentTimetag
			};
			this.db.updateMsg(r)
		})
	}

	function a(e) {
		e.scene = this.message.sceneReverseMap[+e.scene] || e.scene, e.time = +e.time
	}
	s.processMsgExtend = function(e) {
		switch (e.cmd) {
			case "getThreadMsgs":
				this.onGetThreadMsgs(e);
				break;
			case "getMsgsByIdServer":
				this.onGetMsgsByIdServer(e);
				break;
			case "addQuickComment":
				this.changeQuickComment(e);
				break;
			case "deleteQuickComment":
				this.changeQuickComment(e, !0);
				break;
			case "onQuickComment":
			case "syncAddQuickComment":
				this.onQuickComment(e);
				break;
			case "onDeleteQuickComment":
			case "syncDeleteQuickComment":
				this.onQuickComment(e, !0);
				break;
			case "getQuickComments":
				this.getQuickComments(e);
				break;
			case "addCollect":
			case "updateCollect":
				this.addCollect(e);
				break;
			case "deleteCollects":
				this.deleteCollects(e);
				break;
			case "getCollects":
				this.getCollects(e);
				break;
			case "addStickTopSession":
			case "syncAddStickTopSession":
				this.onChangeStickTopSession(e, "add");
				break;
			case "updateStickTopSession":
			case "syncUpdateStickTopSession":
				this.onChangeStickTopSession(e, "update");
				break;
			case "deleteStickTopSession":
			case "syncDeleteStickTopSession":
				this.onChangeStickTopSession(e, "delete");
				break;
			case "addMsgPin":
			case "onAddMsgPin":
			case "syncAddMsgPin":
				this.pinMsgChange(e, "add");
				break;
			case "updateMsgPin":
			case "onUpdateMsgPin":
			case "syncUpdateMsgPin":
				this.pinMsgChange(e, "update");
				break;
			case "deleteMsgPin":
			case "onDeleteMsgPin":
			case "syncDeleteMsgPin":
				this.pinMsgChange(e, "delete");
				break;
			case "getMsgPins":
				this.getMsgPins(e)
		}
	}, s.onGetThreadMsgs = function(e) {
		if (!e.error) {
			e.obj.msgs = this.message.reverseMsgs(e.content.msgs), e.obj.threadMsg = this.message
				.reverse(e.content.threadMsg);
			let t = e.content.threadMsgsMeta || {};
			e.obj.total = t.total, e.obj.timetag = t.lastMsgTime
		}
	}, s.onGetMsgsByIdServer = function(e) {
		e.error || (e.obj.msgs = this.message.reverseMsgs(e.content.msgs))
	}, s.changeQuickComment = function(e, t) {
		e.error || (e.obj.comment.time = e.content.timetag, e.obj.comment = r.reverse(e.obj.comment), a
			.call(this, e.obj.msg), o.call(this, e.obj.msg.idClient, e.obj.comment, t))
	}, s.onQuickComment = function(e, t) {
		if (!e.content) return;
		let {
			comment: n,
			msg: s
		} = e.content;
		if (n && s) {
			if (a.call(this, s), n = r.reverse(n), t) try {
				this.options.onDeleteQuickComment(e.content.msg, n)
			} catch (e) {
				throw this.logger.error("userOption:onDeleteQuickComment function error", e), e
			} else try {
				this.options.onQuickComment(e.content.msg, n)
			} catch (e) {
				throw this.logger.error("userOption:onQuickComment function error", e), e
			}
			o.call(this, s.idClient, n, t)
		}
	}, s.getQuickComments = function(e) {
		if (e.error) return;
		let t = e.obj.idMap,
			n = e.obj.indexMap;
		(e.content && e.content.commentRes || []).forEach(e => {
			var n = [],
				s = this.parser.unserializeMap.comment;
			if (1 == +e.modify) try {
				n = JSON.parse(e.detail)
			} catch (e) {
				this.logger.warn("getQuickComments parse detail error", e)
			}
			if (n.forEach((e, t) => {
					let i = {};
					Object.keys(e).forEach(t => {
						i[s[t]] = e[t]
					}), i = r.reverse(i), n[t] = i
				}), e.timestamp = +e.timestamp, t[e.idClient]) {
				const s = {
					idClient: e.idClient,
					commentTimetag: e.timestamp
				};
				t[e.idClient].commentTimetag = e.timestamp, 1 == +e.modify && (t[e.idClient]
					.comments = n, s.comments = n), this.db.enable && this.db.updateMsg(s)
			} else t[e.idClient] = {
				idServer: e.idServer,
				idClient: e.idClient,
				comments: n,
				commentTimetag: e.timestamp
			}
		}), e.obj = [], Object.keys(n).forEach(s => {
			e.obj[n[s]] = t[s]
		})
	}, s.addCollect = function(e) {
		e.error || (e.obj.collect = i.reverse(e.content.collect))
	}, s.deleteCollects = function(e) {
		e.error || (e.obj.deleteNum = e.content.deleteNum)
	}, s.getCollects = function(e) {
		if (!e.error) {
			var t = [];
			(e.content.collectList || []).forEach(e => {
				t.push(i.reverse(e))
			}), e.obj.collectList = t, e.obj.total = e.content.total
		}
	}, s.onChangeStickTopSession = function(e, t) {
		if (e.error) return;
		let n = e.content.stickTopSession || e.obj.stickTopSession || {},
			s = e.content.timetag || +n.updateTime,
			r = n.id.split("|");
		"super_team" === r[0] && (r[0] = "superTeam"), n = {
			id: r.join("-"),
			scene: r[0],
			to: r[1],
			topCustom: n.topCustom || ""
		}, "delete" === t ? n.isTop = !1 : "add" === t && (n.isTop = !0), n = this.onUpdateSession(
			n), e.obj && (e.obj.stickTopSession = n), this.db.enable && (this.db.updateSession(n)
			.then(e => {
				e || this.db.putSession(n)
			}), this.db.updateTimetag("stickTopSessions", s))
	}, s.pinMsgChange = function(e, t) {
		if (e.error) return;
		e.content = e.content || {};
		let n = this,
			s = this.db,
			r = e.obj && e.obj.msg,
			i = e.content.msg || r || {},
			o = e.content.pinTag || e.obj.pinTag,
			c = e.content.timetag || +o.updateTime,
			m = Promise.resolve();
		a.call(this, i), s.enable && (m = s.getMsgByIdClient(i.idClient)), o.createTime && (o
			.createTime = +o.createTime), o.updateTime && (o.updateTime = +o.updateTime), m.then(
			a => {
				if (i = a || i, a ? i = a : i.sessionId = i.scene + "-" + this.message.Message
					.getMsgTarget(i, this.account), r) e.obj.msg = i, e.obj.pinTag = o;
				else try {
					this.options.onPinMsgChange({
						msg: i,
						pinTag: o
					}, t)
				} catch (e) {
					throw n.logger.error("userOption:onPinMsgChange function error", e), e
				}
				return function() {
					if (!s.enable) return;
					s["delete" === t ? "deleteMsgPin" : "putMsgPin"]({
						...i,
						pinFrom: o.pinFrom,
						pinCustom: o.pinCustom
					}).then(() => {
						let e = "pin-" + i.sessionId,
							t = n.timetags.sync;
						return s.getTimetag(e).then(n => n > t ? s.updateTimetag(e, c) :
							Promise.resolve())
					}).catch(e => {
						n.logger.error("msgExtend::pinMsgChange:error", e)
					})
				}(), Promise.resolve
			}).then(() => {}), e.promise = m
	}, s.getMsgPins = function(e) {
		if (e.error) return;
		let t = this.db,
			n = e.content || {};
		if (n.pins = n.pins || [], n.modify) {
			let s = [];
			t.enable && (t.updateTimetag("pin-" + e.obj.id, n.timetag), n.pins.forEach(n => {
				n.sessionId = e.obj.id, s.push(t.getMsgByIdClient(n.idClient))
			})), e.promise = Promise.all(s).then(s => {
				n.pins.forEach((t, n) => {
					s[n] ? Object.assign(t, s[n]) : (t.sessionId = e.obj.id, a.call(
						this, t))
				}), e.obj.pins = n.pins, t.enable && t.deleteMsgPins(e.obj.id).then(() => t
					.putMsgPins(n.pins)).catch(e => {
					this.logger.error("msgExtend::getMsgPins:change db error", e)
				})
			})
		} else t.enable ? (t.updateTimetag("pin-" + e.obj.id, n.timetag), e.promise = t.getMsgPins(e.obj
			.id).then(t => {
			e.obj.pins = t || []
		})) : e.obj.pins = []
	}
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(0);
	n(4);
	s.onOfflineMsgReceipts = function(e) {
		var t, n = this,
			s = n.db,
			r = e.content.msgReceipts,
			i = [],
			o = Promise.resolve();
		this.logger.info("onOfflineMsgReceipts", r), r.forEach((function(e) {
			t = {
				id: "p2p-" + e.from,
				msgReceiptTime: +e.time
			}, n.cacheSyncedSession(t)
		})), n.syncResult.msgReceipts = i, s.enable && (o = s.updateMsgReceiptsTimetag(e.content
			.timetag)), o.cmd = i, n.syncPromiseArray.push(o)
	}, s.shouldUpdateSessionFromMsgReceipt = function(e, t) {
		return !e || !e.msgReceiptServerTime || t.time > e.msgReceiptServerTime
	}, s.genSessionFromMsgReceipt = function(e, t) {
		var n = t.time,
			s = {
				id: t.sessionId,
				msgReceiptTime: n,
				msgReceiptServerTime: n
			};
		return e && e.id === t.sessionId && (s = r.merge({}, e, s)), e && e.updateTime || (s
			.updateTime = n), s
	}, s.onMsgReceipt = function(e) {
		var t = this,
			n = t.db,
			s = e.content.msgReceipt;
		s.time = +s.time;
		var r = s.idClient,
			i = Promise.resolve();
		n.enable && r && (i = n.getMsgByIdClient(r)), this.logger.info("onMsgReceipt::", s), i.then((
			function(e) {
				var n;
				if (e) {
					if (!e.idServer) return void(t.msgReceiptTasks[r] = s);
					n = e.time
				} else n = s.time;
				s.msgReceiptTime = n, t.updateSessionMsgReceiptTime(s)
			}))
	}, s.resolveMsgReceiptTask = function(e) {
		var t = this.msgReceiptTasks[e.idClient];
		t && (t.msgReceiptTime = e.time, this.updateSessionMsgReceiptTime(t))
	}, s.updateSessionMsgReceiptTime = function(e) {
		var t = this.db,
			n = {
				id: "p2p-" + e.from,
				msgReceiptTime: e.msgReceiptTime,
				msgReceiptServerTime: e.time
			};
		(this.findSession(n.id) || {}).msgReceiptTime >= n.msgReceiptTime ? this.logger.warn(
			"receive old msgReceiptTime", e) : (t.enable && t.putSession(n), this.onUpdateSession(
			n))
	}, s.onSendMsgReceipt = function(e) {
		if (!e.error)
			if (e.obj && e.obj.msgReceipt) {
				var t = e.obj.msgReceipt,
					n = +t.time,
					s = +e.content.msgReceipt.time,
					r = this.findSession("p2p-" + t.to);
				this.logger.info(`sendMsgReceipt on:: param time ${n}, res time ${s}`), r
					.msgReceiptSendTime = Math.min(n, s)
			} else this.logger.info("sendMsgReceipt on:: origin msg is missing, it maybe timeout")
	}, s.shouldSendMsgReceipt = function(e) {
		if (e && "p2p" === e.scene && "success" === e.status) {
			var t = this.findSession(e.sessionId);
			if (t) {
				var n = t.msgReceiptSendTime;
				return !n || n < e.time
			}
		}
		return !1
	}, s.isMsgRemoteRead = function(e) {
		if (e && "p2p" === e.scene && "out" === e.flow && "success" === e.status) {
			var t = this.findSession(e.sessionId);
			if (t && t.msgReceiptTime) return e.time <= t.msgReceiptTime
		}
		return !1
	}
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(21),
		i = n(27),
		o = n(0);
	async function a(e, t) {
		const n = this,
			s = n.db,
			r = [];
		if (e.forEach(e => {
				this.revokeMsgUniqueCheck(e.idClient), r.push(e.idClient)
			}), !n.options.rollbackDelMsgUnread) {
			let e = await s.deleteMsg(r) || [];
			return e = "[object Array]" === Object.prototype.toString.call(e) ? e : [e], void n.logger
				.info(`msg::_deleteMsgSelfBatchInDb, rollback false, affect: ${e.length} rows`)
		}
		let i = !1;
		const o = n.options.cbUpdateSession || n.updateLocalSession.bind(n),
			a = n.findSession(t) || {
				id: t
			};
		let c = a.lastMsg || {};
		r.includes(c.idClient) && (i = !0), n.logger.info(
			"msg::_deleteMsgSelfBatchInDb session change before:", t, i, a.unread);
		let m = await s.deleteMsg(r) || [];
		if (m = "[object Array]" === Object.prototype.toString.call(m) ? m : [m], n.logger.info(
				"msg::_deleteMsgSelfBatchInDb affect:", m.length, " rows"), i) {
			const e = await s.getMsgs({
				sessionId: t,
				limit: 1
			});
			c = e && e[0] ? e[0] : c, a.lastMsg = c
		}
		let u = !1;
		if (a && a.unread) {
			let e = a && a.ack || 0;
			m.forEach(t => {
				e < t.time && "in" === t.flow && (a.unread = a.unread - 1, u = !0)
			})
		}
		if (i || u) return n.logger.info("msg::_deleteMsgSelfBatchInDb session change after:", t, a
			.unread), o(a)
	}

	function c(e, t) {
		t = t || (new Date).getTime();
		var n = this.db,
			s = this.findSession(e),
			r = !1 !== this.options.rollbackClearMsgsUnread,
			i = [];
		return n.enable && i.push(n.deleteMsgsBySessionId({
			sessionId: e,
			end: t
		})), r && s && (s = this.mergeSession({
			id: s.id,
			unread: 0,
			lastMsg: null
		}), s = this.onUpdateSession(s)), n.enable && r && s && i.push(n.updateSession(s)), Promise.all(
			i)
	}
	s.onDeleteMsg = function(e) {
		var t = this.db;
		if (delete e.obj.sysMsg, !e.error) {
			var n = e.obj.msg;
			e.promise = this.deleteLocalMsg(n).then((function() {
				if (t.enable) {
					var e = "superTeam" === n.scene ? "deleteSuperTeamMsg" : "deleteMsg";
					t.getTimetag(e).then((function(n) {
						n = n || 0, Date.now() + 1 >= n && t.updateTimetag(e,
							Date.now() + 1)
					}))
				}
			}))
		}
	}, s.onMsgDeleted = function(e, t) {
		if (!e.error) {
			var n = this,
				s = n.db,
				i = r.reverse(e.content.sysMsg);
			i = n.processDeleteMsgSysMsg(i), t || n.markSysMsgRead(i), n.deleteLocalMsg(i.msg).then((
				function() {
					if (s.enable) {
						let e = t ? "deleteSuperTeamMsg" : "deleteMsg";
						s.updateTimetag(e, i.time + 1)
					}
					n.handleSysMsg(i)
				}))
		}
	}, s.processDeleteMsgSysMsg = function(e) {
		return e.msg = {}, ["scene", "from", "to"].forEach((function(t) {
				e.msg[t] = e[t]
			})), e.msg.idClient = e.deletedIdClient, e.msg.idServer = e.deletedIdServer, e.msg.time = e
			.deletedMsgTime, e.msg.fromNick = e.deletedMsgFromNick, e.opeAccount = e.opeAccount || e
			.from, e.msg.opeAccount = e.opeAccount, this.message.Message.setExtra(e.msg, this.account),
			e
	}, s.onDeleteMsgOfflineRoaming = function(e) {
		if (!e.error) {
			var t = this,
				n = 1 == +e.content.type ? "offline" : "roaming",
				s = r.reverseSysMsgs(e.content.sysMsgs, {
					mapper: function(e) {
						return t.processDeleteMsgSysMsg(e)
					}
				}),
				i = s && s[0] && "superTeam" === s[0].scene;
			t.logger.info(
					`msg::onDeleteMsgOfflineRoaming: on delete ${n} ${i?"superTeam":""} idServer deletedIdClient deletedIdClient=`,
					s.map(e => `${e.idServer}-${e.deletedIdServer}-${e.deletedIdClient}`)),
				"offline" === n && t.markSysMsgRead(s);
			var o = e.content.timetag;
			i ? (t.timetags.deleteSuperTeamMsg = o, t.syncResult.deleteSuperTeamMsgTimetag = o) : (t
				.timetags.deleteMsg = o, t.syncResult.deleteMsgTimetag = o);
			var a = t.putSysMsg(s, "offlineSysMsgs").catch(e => (t.logger.error(
				"msgDelete::onDeleteMsgOfflineRoaming: ", e), Promise.reject(e)));
			a.cmd = "deleteMsgSysMsgs " + n, t.syncPromiseArray.push(a), t.syncResult.deleteMsgSysMsgs =
				t.syncResult.deleteMsgSysMsgs || [], t.syncResult.deleteMsgSysMsgs.push({
					type: n,
					sysMsgs: s
				})
		}
	}, s.deleteMsgOfflineRoaming = function(e, t) {
		if (!e) return Promise.resolve();
		var n = this;
		n.logger.info("msg::deleteMsgOfflineRoaming: ", e.map(e => e.type + " " + e.sysMsgs.map(e =>
			`${e.idServer}-${e.deletedIdServer}-${e.deletedIdClient}`)), o.secureOutput(
			"session", t));
		var s = n.db,
			r = [];
		return e.forEach((function(e) {
			e.sysMsgs.forEach((function(e) {
				var a = n.deleteLocalMsg(e.msg, {
					cbUpdateSession(e) {
						e = n.mergeSession(e), e = o.simpleClone(e), i
							.trim(e);
						var r = o.findObjIndexInArray(t, {
							value: e.id
						});
						if (-1 !== r && (t[r] = o.merge({}, t[r], e)), s
							.enable) return s.updateSession(e)
					}
				});
				r.push(a)
			}))
		})), Promise.all(r).then((function() {
			s.enable && (n.syncResult.deleteMsgTimetag && s.updateTimetag("deleteMsg", n
					.syncResult.deleteMsgTimetag), n.syncResult
				.deleteSuperTeamMsgTimetag && s.updateTimetag("deleteSuperTeamMsg", n
					.syncResult.deleteSuperTeamMsgTimetag))
		}))
	}, s.deleteMsgSelf = function(e) {
		if (!e.error) {
			var t = this.db,
				n = e.obj && e.obj.deleteMsgSelfTag;
			if (n) {
				var s = e.content && e.content.timetag;
				n.scene = n.scene + "" == "1" ? "p2p" : "team";
				var r = [this.deleteLocalMsg(n)];
				s <= this.timetags.deleteMsgSelf || (this.timetags.deleteMsgSelf = s, t.enable && r
					.push(t.updateDeleteMsgSelf(s))), e.promise = Promise.all(r)
			}
		}
	}, s.deleteMsgSelfBatch = async function(e) {
		if (e.error) return;
		var t = this,
			n = this.db,
			s = e.obj && e.obj.deleteMsgSelfTags;
		if (!(s && s.length > 0)) return;
		var r = s.reduce((e, t) => {
			let n = t.sessionId;
			return e[n] = e[n] || [], e[n].push(t), e
		}, {});
		if (!n.enable) return Object.keys(r).forEach(e => {
			var n = r[e],
				s = t.findSession(e);
			if (t.options.rollbackDelMsgUnread && s) {
				var i = s.ack || 0,
					o = n.filter(e => i < e.time && "in" === e.flow);
				o.length > 0 && s.unread && (s.unread = s.unread ? s.unread - o.length :
					0, t.onUpdateSession(s))
			}
		}), Promise.resolve();
		const i = Object.keys(r).map(e => {
			var n = r[e];
			return a.call(t, n, e)
		});
		var o = e.content && e.content.timetag;
		o <= t.timetags.deleteMsgSelf || (t.timetags.deleteMsgSelf = o, i.push(n
			.updateDeleteMsgSelf(o))), e.promise = Promise.all(i)
	}, s.onDeleteMsgSelf = function(e) {
		var t = this,
			n = this.db,
			s = e.content.deleteMsgSelfTag;
		s.scene = s.scene + "" == "1" ? "p2p" : "team";
		try {
			t.options.onDeleteMsgSelf([s])
		} catch (e) {
			throw t.logger.error("userOption:onDeleteMsgSelf function error", e), e
		}
		t.deleteLocalMsg(s).then(() => {
			var e = s.deletedTime;
			return e <= t.timetags.deleteMsgSelf || !n.enable ? Promise.resolve() : (t
				.timetags.deleteMsgSelf = e, n.updateDeleteMsgSelf(e))
		}).catch(e => {
			t.logger.error("onDeleteMsgSelf error", e)
		})
	}, s.onDeleteMsgSelfBatch = function(e) {
		if (e.error) return;
		var t = {
			1: "p2p",
			2: "team"
		};
		const n = o.get(e, "content.deleteMsgSelfTags") || [];
		n.forEach(e => {
			e.sessionId = `${t[e.scene]}-${e.from}`, e.deletedTime = parseInt(e
				.deletedTime), e.time = parseInt(e.time)
		});
		let s = o.get(e, "content.deleteMsgSelfTags[0].deletedTime");
		s = parseInt(s) || 0, this.deleteMsgSelfBatch({
			obj: {
				deleteMsgSelfTags: n
			},
			content: {
				timetag: s
			}
		})
	}, s.clearServerHistoryMsgs = function(e) {
		if (!e.error) {
			var t = this.db,
				n = e.obj && e.obj.clearMsgsParamsWithSync;
			if (n) {
				var s = "p2p" === (n.type && "2" === n.type.toString() ? "team" : "p2p") ? "p2p-" +
					n.otherAccid : "team-" + n.toTid,
					r = e.content && parseInt(e.content.timetag);
				r && r > this.timetags.sessionHistoryMsgsDelete && (this.timetags
						.sessionHistoryMsgsDelete = r, t.enable && t.updateTimetag(
							"sessionHistoryMsgsDelete", this.timetags.sessionHistoryMsgsDelete)), c
					.call(this, s, r)
			}
		}
	}, s.onClearServerHistoryMsgs = function(e) {
		if (!e.error) {
			var t = this.db,
				n = e.content && e.content.sessionHistoryMsgsDeleteTag;
			if (n) {
				var s = "p2p" === (n.type && "2" === n.type.toString() ? "team" : "p2p") ? "p2p-" +
					n.otherAccid : "team-" + n.toTid,
					r = parseInt(n.time);
				this.options.onClearServerHistoryMsgs && this.options.onClearServerHistoryMsgs([{
						sessionId: s,
						time: r
					}]), r <= this.timetags.sessionHistoryMsgsDelete || (this.timetags
						.sessionHistoryMsgsDelete = r, t.enable && t.updateTimetag(
							"sessionHistoryMsgsDelete", this.timetags.sessionHistoryMsgsDelete)), c
					.call(this, s, r)
			}
		}
	}, s.syncSessionHistoryMsgsDelete = function(e) {
		if (!e.error) {
			var t = this.db,
				n = e.content && e.content.sessionHistoryMsgsDeleteTags;
			if (n && n.length > 0) {
				var s = n.map(e => ({
					sessionId: "p2p" === (e.type && "2" === e.type.toString() ? "team" :
						"p2p") ? "p2p-" + e.otherAccid : "team-" + e.toTid,
					time: parseInt(e.time)
				}));
				this.options.onClearServerHistoryMsgs && this.options.onClearServerHistoryMsgs(s),
					this.syncResult.clearServerHistoryMsgs = s;
				var r = 0;
				s.forEach(e => {
					e.time > r && (r = e.time)
				}), t.enable && t.updateTimetag("sessionHistoryMsgsDelete", r)
			}
		}
	}, s.syncDeleteMsgSelf = function(e) {
		var t = this,
			n = this.db,
			s = e.content.deletedMsgs;
		if (s && 0 !== s.length) {
			var r = [];
			s.forEach(e => {
				e.scene = "1" === e.scene ? "p2p" : "team", e.deletedTime = +e.deletedTime,
					e.time = +e.time, r.push(t.deleteLocalMsg(e))
			});
			try {
				t.options.onDeleteMsgSelf(s)
			} catch (e) {
				throw t.logger.error("userOption:onDeleteMsgSelf function error", e), e
			}
			Promise.all(r).then(() => {
				var e = s.slice(-1)[0].deletedTime;
				if (!(t.timetags.deleteMsgSelf >= e)) return t.timetags.deleteMsgSelf = e, n
					.enable ? n.updateDeleteMsgSelf(e) : void 0
			}).catch(e => {
				t.logger.error("syncDeleteMsgSelf error", e)
			})
		}
	}, s.deleteLocalMsg = function(e, t) {
		var n = this,
			s = n.db,
			r = (t = t || {}).cbUpdateSession || n.updateLocalSession.bind(n);
		this.revokeMsgUniqueCheck(e && e.idClient);
		var i = e.sessionId || e.scene + "-" + this.message.Message.getMsgTarget(e, this.account);
		if (s.enable && e) {
			var o = !1,
				a = null,
				c = null;
			return s.getMsgs({
				sessionId: i,
				limit: 1
			}).then((function(t) {
				t && t[0] && t[0].idClient === e.idClient && (o = !0)
			})).then((function() {
				return s.getMsgByIdClient(e.idClient)
			})).then((function(t) {
				return c = t, s.deleteMsg(e.idClient)
			})).then((function() {
				if (o) return s.getMsgs({
					sessionId: i,
					limit: 1
				})
			})).then((function(e) {
				o && e && e[0] && (a = e[0])
			})).then((function() {
				if (n.options.rollbackDelMsgUnread) return s.getSession(i)
			})).then((function(e) {
				var t = e || {
					id: i
				};
				o && (t.lastMsg = a);
				var s = e && e.ack || 0,
					m = !1;
				return e && c && s < c.time && "in" === c.flow && e.unread && (n.logger
						.info("msgDelete::deleteLocalMsg:db.getSessions: unread", e.id,
							e.unread), t.unread = e.unread - 1, m = !0), o || m ? r(t) :
					Promise.resolve()
			}))
		}
		var m = !1,
			u = n.findSession(i);
		if (n.options.rollbackDelMsgUnread && e && e.sessionId && u) {
			var l = u.ack || 0;
			u && l < e.time && "in" === e.flow && u.unread && (n.logger.info(
					"msgDelete::deleteLocalMsg::no db: ", u.id), u.unread = u.unread - 1, m = !
				0)
		}
		return u && u.lastMsg && e && u.lastMsg.idClient == e.idClient && (u.lastMsg = null, m = !
			0), m && n.onUpdateSession(u), Promise.resolve()
	}
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(0),
		i = n(21);
	s.splitSysMsgs = function(e, t) {
		for (var n, s = e.length - 1; s >= 0; s--) n = e[s], i.isCustom(n) && (e.splice(s, 1), t.push(
			n))
	}, s.onOfflineSysMsgs = function(e, t) {
		var n = this,
			s = e.content.sysMsgs.map((function(e) {
				return e = i.reverse(e), t && (e.filter = !0), e
			}));
		s = s.reverse(), n.markSysMsgRead(s);
		var r = [];
		n.splitSysMsgs(s, r);
		var o = t ? "offlineFilterSysMsgs" : "offlineSysMsgs",
			a = t ? "offlineFilterCustomSysMsgs" : "offlineCustomSysMsgs";
		if (s.length) {
			var c = n.putSysMsg(s, "offlineSysMsgs").then((function(e) {
				(s = e).length && (n.logger.info("sysmsg::onOfflineSysMsgs: ", o, s.length,
						s && s.map(e => e.idServer)), n.syncResult[o] = n.syncResult[
					o] || [], n.syncResult[o] = n.syncResult[o].concat(s))
			})).catch(e => (n.logger.error("sysMsg::onOfflineSysMsgs: ", e), Promise.reject(e)));
			c.cmd = "sysMsgs", n.syncPromiseArray.push(c)
		}
		r.length && (n.logger.info("sysmsg::onOfflineSysMsgs: ", a, r.map(e => e.idServer)), n
			.syncResult[a] = n.syncResult[a] || [], n.syncResult[a] = n.syncResult[a].concat(r))
	}, s.onSendSysMsg = function(e, t) {
		var n = e.obj || {};
		n ? (this.completeSysMsg(n), e.error ? n.status = "fail" : n.status = "success", n = i.reverse(
			n), t && (e.obj.filter = !0), e.obj = n) : this.logger.warn("onSendSysMsg::no obj")
	}, s.completeSysMsg = function(e) {
		return e.from = this.account, e
	}, s.onSysMsg = function(e, t) {
		var n = i.reverse(e.content.sysMsg);
		if (t && (n.filter = !0), this.markSysMsgRead(n), i.isCustom(n)) {
			this.logger.info("sysmsg::onSysMsg: on customSysMsg");
			try {
				this.options.oncustomsysmsg(n)
			} catch (e) {
				throw this.logger.error("userOption:oncustomsysmsg function error", e), e
			}
		} else this.syncing ? this.unhandledSysMsgs.push(n) : this.handleSysMsg(n)
	}, s.handleSysMsg = function(e) {
		var t = this,
			n = e.type,
			s = e.from,
			i = e.serverex;
		t.sysMsgPromise = t.sysMsgPromise.then((function() {
			return t.putSysMsg(e, "onSysMsg")
		})).then((function(t) {
			e = t[0]
		})).then((function() {
			if (e) {
				var r, o = Promise.resolve();
				switch (n) {
					case "addFriend":
						r = {
							type: "addFriend",
							account: s
						}, i && (r.serverex = i), o = t.onFriendRequest(r);
						break;
					case "passFriendApply":
						r = {
							type: "passFriendApply",
							account: s
						}, o = t.onFriendRequest(r);
						break;
					case "deleteFriend":
						o = t.onDeleteFriend({
							account: s
						})
				}
				return r && r.friend && (e.friend = r.friend), o
			}
		})).then((function() {
			e && (t.logger.info("sysmsg::handleSysMsg: ", n, r.pickAsString(e, ["idServer",
				"deletedIdClient", "deletedIdServer"
			])), setTimeout((function() {
				try {
					t.options.onsysmsg(e)
				} catch (e) {
					throw t.logger.error(
						"userOption:onsysmsg function error", e), e
				}
			}), 0))
		}))
	}, s.putSysMsg = function(e, t) {
		if (r.isArray(e) || (e = [e]), e[0].filter) return Promise.resolve(e);
		var n = this,
			s = n.db,
			i = s.enable,
			o = Promise.resolve(),
			a = [];
		return (o = (o = o.then((function() {
			return i ? s.putSysMsg(e) : e
		})).then((function(t) {
			var s = [];
			e.forEach((function(e) {
				n.checkSysMsgUnique(e) && s.push(e)
			})), e = s, a = i ? t : e
		}))).then((function() {
			return n.getSysMsgUnread().then((function(s) {
				return a.length || ((a = e).backward = !0), n
					.updateSysMsgUnread(a, s, 1).then((function(e) {
						"offlineSysMsgs" === t && (n.syncResult
								.sysMsgUnread = e), "onSysMsg" ===
							t && n.onUpdateSysMsgUnread(e)
					}))
			}))
		}))).then((function() {
			return e
		}))
	}, s.checkSysMsgUnique = r.genCheckUniqueFunc("idServer"), s.getSysMsgUnread = function() {
		var e = this,
			t = e.db;
		return new Promise((function(n) {
			t.enable ? t.getSysMsgUnread().then((function(e) {
				n(e)
			}), (function() {
				n(e.sysMsgUnread)
			})) : n(e.sysMsgUnread)
		}))
	}, s.updateSysMsgUnread = function(e, t, n) {
		if (r.isArray(e) || (e = [e]), !e.length) return Promise.resolve(t);
		t = t || {};
		var s, o = this.db;
		return e.forEach((function(e) {
				(n > 0 && !e.read || n < 0 && e.read) && (s = e.type, t[s] = (t[s] || 0) + n)
			})), t = i.completeUnread(t), this.sysMsgUnread = t, o.enable && !e.backward ? o
			.updateSysMsgUnread(t) : Promise.resolve(t)
	}, s.reduceSysMsgUnread = function(e) {
		var t = this;
		return t.getSysMsgUnread().then((function(n) {
			return t.updateSysMsgUnread(e, n, -1)
		})).then((function(e) {
			t.onUpdateSysMsgUnread(e)
		}))
	}, s.onUpdateSysMsgUnread = function(e) {
		var t = this;
		setTimeout((function() {
			t.logger.info("sysmsg::onUpdateSysMsgUnread:", e);
			try {
				t.options.onupdatesysmsgunread(e)
			} catch (e) {
				throw t.logger.error("userOption:onupdatesysmsgunread function error", e), e
			}
		}), 0)
	}, s.updateSysMsg = function(e) {
		var t = this,
			n = t.db;
		(n.enable ? n.updateSysMsg(e) : Promise.resolve(e)).then((function(e) {
			t.onUpdateSysMsg(e)
		}))
	}, s.onUpdateSysMsg = function(e) {
		var t = this;
		setTimeout((function() {
			r.isArray(e) || (e = [e]), e.forEach((function(e) {
				t.logger.info("sysmsg::onUpdateSysMsg:", e.idServer);
				try {
					t.options.onupdatesysmsg(e)
				} catch (e) {
					throw t.logger.error(
						"userOption:onupdatesysmsg function error", e), e
				}
			}))
		}), 0)
	}, s.processUnsettledSysMsgs = function() {
		var e = this;
		e.unhandledSysMsgs.forEach((function(t) {
			e.handleSysMsg(t)
		})), e.resetUnsettledSysMsgs()
	}
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(0),
		i = n(27),
		o = n(4);
	const a = n(21);
	s.processSession = function(e) {
		if (!e.error) switch (e.cmd) {
			case "getServerSessions":
				this.onGetServerSessions(e);
				break;
			case "getServerSession":
				this.onGetServerSession(e);
				break;
			case "updateServerSession":
				this.onUpdateServerSession(e)
		}
	}, s.onGetServerSessions = function(e) {
		var t = this,
			n = e.content && e.content.sessionReqTag,
			s = e.content && e.content.sessionList,
			r = [];
		s.forEach(e => {
			if (e.id = e.id.split("|").join("-"), 0 === e.id.indexOf("super_team") && (e.id =
					"superTeam" + e.id.slice(10)), e.updateTime = +e.updateTime, e.lastMsg) {
				var n = "1" === e.lastMsgType ? "sysMsg" : "msg";
				r.push(t.parser.unserialize(JSON.parse(e.lastMsg), n).then(s => {
					e.lastMsg = "msg" === n ? t.message.reverse(s) : a.reverse(s)
				}))
			}
		}), e.promise = Promise.all(r).then(() => {
			e.obj = {
				sessionList: s,
				hasMore: "1" === n.hasMore
			}, n.minTimestamp && (e.obj.minTimestamp = +n.minTimestamp)
		})
	}, s.onGetServerSession = function(e) {
		var t = this,
			n = e.content && e.content.session;
		if (n)
			if (n.id = n.id.split("|").join("-"), 0 === n.id.indexOf("super_team") && (n.id =
					"superTeam" + n.id.slice(10)), n.updateTime = +n.updateTime, n.lastMsg) {
				var s = e.content.session && "1" === e.content.session.lastMsgType ? "sysMsg" : "msg";
				e.promise = t.parser.unserialize(JSON.parse(n.lastMsg), s).then(r => {
					n.lastMsg = "msg" === s ? t.message.reverse(r) : a.reverse(r), e.obj = n
				})
			} else e.obj = n
	}, s.onUpdateServerSession = function(e) {
		e.obj = {}
	}, s.onSyncUpdateServerSession = function(e) {
		var t = this,
			n = e.content && e.content.session;
		if (n)
			if (n.id = n.id.split("|").join("-"), 0 === n.id.indexOf("super_team") && (n.id =
					"superTeam" + n.id.slice(10)), n.updateTime = +n.updateTime, n.lastMsg) t.parser
				.unserialize(JSON.parse(n.lastMsg), "msg").then(e => {
					n.lastMsg = t.message.reverse(e);
					try {
						this.options.onSyncUpdateServerSession(r.simpleClone(n))
					} catch (e) {
						throw t.logger.error("userOption:onSyncUpdateServerSession function error",
							e), e
					}
				});
			else try {
				this.options.onSyncUpdateServerSession(r.simpleClone(n))
			} catch (e) {
				throw t.logger.error("userOption:onSyncUpdateServerSession function error", e), e
			}
	}, s.mergeSession = function(e) {
		e = r.copyWithNull(e);
		var t = this.sessionSet,
			n = e.id,
			s = t[n] || {},
			o = !1;
		return i.isComplete(e) ? delete s.isDeleted : s.isDeleted && (o = !0), t[n] = r.merge(s, e), e =
			o ? e : t[n], r.undef(e.unread) && (e.unread = 0), e
	}, s.mergeSessions = function(e) {
		return (e = e || []).map(e => this.mergeSession(e))
	}, s.deleteLocalSession = function(e, t) {
		r.isArray(e) || (e = [e]), t ? e.forEach(e => {
			this.sessionSet[e] && (this.sessionSet[e].isDeleted = !0)
		}) : e.forEach(e => delete this.sessionSet[e])
	}, s.onDeleteSessions = function(e) {
		e.obj = e.obj.sessions.map((function(e) {
			return i.parse(e)
		}))
	}, s.onUpdateSession = function(e) {
		if (e) {
			if (e = this.mergeSession(e), e = r.simpleClone(e), i.trim(e), i.isComplete(e)) return this
				.logger.info("session::onUpdateSession: " + e.id, e.id, r.secureOutput("session",
					e)), this.options.onupdatesessions ? this.options.onupdatesessions([e]) : this
				.options.onupdatesession(e), e;
			this.logger.warn("session::onUpdateSession::session is not complete", r.secureOutput(
				"session", e))
		}
	}, s.onUpdateSessions = function(e) {
		var t = this;
		if (!e) return;
		e = t.mergeSessions(e), (e = r.simpleClone(e)).forEach(e => {
			i.trim(e)
		});
		const n = e.filter(e => i.isComplete(e)),
			s = e.filter(e => !i.isComplete(e));
		if (s && s.length > 0 && t.logger.warn("session::onUpdateSessions::sessions is not complete", s
				.map(e => e.id), r.secureOutput("session", s)), 0 !== n.length) return t.logger.info(
				"session::onUpdateSessions:", r.secureOutput("session", n)), t.options
			.onupdatesessions ? t.options.onupdatesessions(n) : n.forEach(e => {
				t.options.onupdatesession(e)
			}), n;
		t.logger.warn("session::onUpdateSessions::completeSessions is empty")
	}, s.setCurrSession = function(e) {
		e = "" + e, this.currSessionId = e, this.logger.info("session::setCurrSession:", e)
	}, s.findSession = function(e, t) {
		const n = this.sessionSet[e];
		return !n || n.isDeleted && !t ? void 0 : n
	}, s.resetSessionUnread = function(e) {
		const t = e.id;
		this.db.enable && this.db.updateSession({
				id: t,
				unread: 0
			}), !this.options.autoMarkRead && this.sessionUnreadMsgs && this.sessionUnreadMsgs[t] && (
				this.markMsgRead(this.sessionUnreadMsgs[t], !0), this.sessionUnreadMsgs[t] = []), this
			.findSession(t) ? this.onUpdateSession({
				id: t,
				unread: 0
			}) : this.onUpdateSession({
				...e,
				unread: 0
			})
	}, s.resetSessionsUnread = function(e) {
		var t = this.db;
		t.enable && e.map(e => {
			t.updateSession({
				id: e.id,
				unread: 0
			})
		});
		const n = !this.options.autoMarkRead && this.sessionUnreadMsgs;
		e = e.map(e => (n && this.sessionUnreadMsgs[e.id] && (this.markMsgRead(this.sessionUnreadMsgs[e
			.id], !0), this.sessionUnreadMsgs[e.id] = []), this.findSession(e.id) ? {
			id: e.id,
			unread: 0
		} : {
			...e,
			unread: 0
		})), this.onUpdateSessions(e)
	}, s.insertLocalSession = function(e) {
		var t = this,
			n = t.db,
			s = e.scene + "-" + e.to,
			a = t.findSession(s);
		if (a && i.isComplete(a)) return Promise.reject(o.sessionExist({
			callFunc: "session::insertLocalSession",
			session: a
		}));
		return (n.enable ? n.getMsgs({
			sessionId: s,
			limit: 1
		}) : Promise.resolve()).then(o => {
			if (r.isArray(o) && 1 === o.length) {
				var c = o[0];
				(a = i.genSessionByMsg(c)).updateTime = c.time
			} else a = {
				id: s,
				scene: e.scene,
				to: e.to,
				updateTime: +e.updateTime || +new Date,
				lastMsg: null
			};
			return t.onUpdateSession(a), n.enable ? n.putSession(a) : Promise.resolve(a)
		})
	}, s.updateLocalSession = function(e, t) {
		var n = this;
		return new Promise((function(s, i) {
			var a = n.db;
			if (n.findSession(e.id)) {
				var c = Promise.resolve(),
					m = r.filterObj(e, "id lastMsg localCustom unread");
				a.enable && (c = a.updateSession(m)), c.then((function(e) {
					return n.onUpdateSession(e, t)
				})).then(s, (function(e) {
					i({
						callFunc: "session::updateLocalSession",
						event: e
					})
				}))
			} else i(o.sessionNotExist({
				sessionId: e.id,
				callFunc: "session::updateLocalSession"
			}))
		}))
	}, s.checkAndUpdateLocalSessionByMsg = function(e) {
		var t, n = this.db,
			s = this,
			i = this.options.syncSessionUnread && e !== this.currSessionId,
			o = n.getMsgs({
				sessionId: e,
				limit: 1
			}),
			a = n.getSession(e).then(r => {
				if (r) return t = Object.assign({}, r), r.ack = r.ack || 0, i ? n.getMsgs({
					sessionId: e,
					start: r.ack
				}) : Promise.resolve();
				s.logger.error("can't find session that sessionId = " + e)
			});
		return Promise.all([o, a]).then(([i, o]) => {
			let a = {
				id: e
			};
			var c, m;
			if (c = t.lastMsg ? t.lastMsg.idClient : null, i && i[0] ? m = (i = i[0]).idClient :
				(m = null, i = null), c !== m && (a.lastMsg = i), void 0 !== o) {
				let e = 0;
				(o = o || []).forEach(t => {
					let n;
					try {
						n = s.options.shouldCountNotifyUnread(t)
					} catch (e) {
						throw s.logger.error(
								"userOption:shouldCountNotifyUnread function error", e),
							e
					}
					t.isUnreadable && "in" === t.flow && ("notification" !== t.type ||
						n) && e++
				}), e !== t.unread && (a.unread = e)
			}
			return Object.keys(a).length > 1 ? (s.logger.info(
				"session::checkAndUpdateLocalSessionByMsg::needUpdate newSession:", r
				.secureOutput("session", a)), n.updateSession(a).then(e => s
				.onUpdateSession(a))) : Promise.resolve(200)
		})
	}, s.syncSessionsWithMoreRoaming = function(e) {
		let t = e && e.content && e.content.sessions;
		if (!t || !t.length) return;
		let n = {
			0: "p2p",
			1: "team",
			5: "superTeam"
		};
		if (t.forEach(e => {
				var t = e.to === this.options.account ? e.from : e.to;
				e.scene = n[e.scene], e.id = `${e.scene}-${t}`, e.time = +e.time
			}), this.db.enable) {
			let e = this.db.putSessionsWithMoreRoaming(t);
			e.cmd = "syncSessionsWithMoreRoaming", this.syncPromiseArray.push(e)
		}
		this.syncing && this.syncResult ? this.syncResult.sessionsWithMoreRoaming = t : this.logger
			.warn("syncSessionsWithMoreRoaming::not in syncing or no syncResult")
	}, s.syncStickTopSessions = function(e) {
		let t = this.db,
			n = [],
			s = [],
			r = Promise.resolve(),
			i = e.content.sessions || [];
		this.syncing && this.syncResult ? (i.forEach(e => {
				let r = e.id.split("|");
				"super_team" === r[0] && (r[0] = "superTeam"), e.id = r.join("-"), e.scene = r[
						0], e.to = r[1], e.isTop = !0, n.push(r.join("-")), delete e.createTime,
					delete e.updateTime, t.enable && s.push(t.putSession(e))
			}), t.enable && (r = t.updateTimetag("stickTopSessions", e.content.timetag)), r.then(
			() => t.enable ? t.getStickTopSessions() : []).then(r => {
				if (e.content.modify) {
					let e = [];
					r.forEach(r => {
						n.indexOf(r.id) > -1 || (e.push(r.id), r.isTop = !1, r
							.topCustom = "", s.push(t.putSession(r)))
					})
				} else this.syncResult.stickTopSessions = r;
				return Promise.all(s)
			}), this.syncResult.stickTopSessions = i, r.cmd = "syncStickTopSessions", this
			.syncPromiseArray.push(r)) : this.logger.warn(
			"syncSessionsWithMoreRoaming::not in syncing or no syncResult")
	}
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(0);
	s.syncSessionAck = function(e) {
		const t = this;
		if (this.logger.info("syncSessionAck::", e.content), t.syncing && t.syncResult) {
			t.saveAck.p2pTeam = e.content.timetag;
			var n = {};
			[
				[e.content.p2p, "p2p"],
				[e.content.team.m_map, "team"]
			].forEach(e => {
					const s = e[0],
						r = e[1];
					Object.keys(s).forEach(e => {
						n[`${r}-${e}`] = s[e];
						var i = {
							id: `${r}-${e}`,
							ack: s[e]
						};
						t.cacheSyncedSession(i)
					})
				}), t.syncResult.ackMap ? t.syncResult.ackMap = Object.assign(t.syncResult.ackMap, n) :
				t.syncResult.ackMap = n
		} else t.logger.warn("syncSessionAck: not in syncing or no syncResult", t.syncing, !!t
			.syncResult)
	}, s.syncSuperTeamSessionAck = function(e) {
		var t = this;
		if (t.syncResult) {
			t.saveAck.superTeam = e.content.timetag;
			var n = {},
				s = e.content.superTeam.m_map;
			Object.keys(s).forEach(e => {
					n["superTeam-" + e] = s[e];
					var r = {
						id: "superTeam-" + e,
						ack: s[e]
					};
					t.cacheSyncedSession(r)
				}), t.syncResult.ackMap ? t.syncResult.ackMap = Object.assign(t.syncResult.ackMap, n) :
				t.syncResult.ackMap = n
		}
	}, s.onMarkSessionAck = function(e) {
		e.error || this.storeSessionAck(e.obj)
	}, s.syncMarkSessionAck = function(e) {
		this.storeSessionAck(e.content, !0)
	}, s.storeSessionAck = function(e, t) {
		const n = this;
		if (!n.options.syncSessionUnread || !e) return;
		var s;
		switch (e.scene) {
			case 0:
				s = "p2p";
				break;
			case 1:
				s = "team";
				break;
			case void 0:
			default:
				s = "superTeam"
		}
		const i = `${s}-${e.to}`,
			o = e.timetag;
		if (o <= ((n.findSession(i) || {}).ack || 0)) return void n.logger.warn(
			"session::storeSessionAck: ack <= ackInMemory", o);
		const a = {
			id: i,
			ack: o
		};
		n.mergeSession(a), n.logger.info("session::storeSessionAck:", r.secureOutput("session", a)), n
			.markUnreadBySessionAck({
				sessionId: i,
				ack: a.ack
			}, t)
	}, s.markUnreadBySessionAck = function({
		sessionId: e,
		ack: t
	}, n) {
		const s = this,
			r = s.db;
		if (r.enable) s.pushMsgTask((function() {
			return r.getMsgCountAfterAck({
				shouldCountNotifyUnread: s.options.shouldCountNotifyUnread,
				sessionId: e,
				ack: t
			}).then(i => {
				const o = {
					id: e,
					unread: i,
					ack: t
				};
				return s.logger.info(
						"session::markUnreadBySessionAck: db.getMsgCountAfterAck done",
						o), s.syncing ? s.cacheSyncedSession(o) : n && s
					.onUpdateSession(o), r.updateSession(o)
			}).catch(e => {
				s.logger.error("markUnreadBySessionAck::error", e)
			})
		}));
		else {
			const r = s.findSession(e);
			if (r) {
				const e = r.unreadMsgs;
				if (e && e.length) {
					let i = 0;
					const o = [];
					for (let n = e.length - 1; n >= 0; n--) {
						const s = e[n];
						if (!(s.time > t)) break;
						i++, o.push(s)
					}
					r.unreadMsgs = o, r.unread = i, s.logger.info(
							"session::markUnreadBySessionAck: unread " + i), s.syncing ? s
						.cacheSyncedSession(r) : n && s.onUpdateSession(r)
				}
			}
		}
	}
}, function(e, t, n) {
	var s = n(2).fn;
	s.processChatroom = function(e) {
		switch (e.cmd) {
			case "getChatroomAddress":
				this.onChatroomAddress(e)
		}
	}, s.onChatroomAddress = function(e) {
		e.error || (e.obj.address = e.content.address)
	}
}, function(e, t, n) {
	var s = n(2).fn;
	s.processQchat = function(e) {
		switch (e.cmd) {
			case "getQChatAddress":
				this.onQChatAddress(e)
		}
	}, s.onQChatAddress = function(e) {
		e.error || (e.obj.address = e.content.address)
	}
}, function(e, t, n) {
	n(2).fn.processFilter = function(e) {
		switch (e.cmd) {
			case "sendFilterMsg":
				this.onSendMsg(e, !0);
				break;
			case "filterMsg":
				this.onMsg(e, !0);
				break;
			case "filterSysMsg":
				this.onSysMsg(e, !0);
				break;
			case "sendFilterCustomSysMsg":
				this.onSendSysMsg(e, !0)
		}
	}
}, function(e, t, n) {
	const s = n(5);
	var r = n(2).fn,
		i = n(0);
	const o = s.clientTypeMap;

	function a(e) {
		e = e || {};
		let t = i.copy(e);
		return t.clientType && (t.clientType = o[t.clientType] || ""), t.serverCustom && (t.custom = JSON
			.parse(t.serverCustom), "string" == typeof t.custom[0] && (t.custom = t.custom[0]), delete t
			.serverCustom), t
	}
	r.processEventService = function(e) {
		let t = this,
			n = e.content,
			s = e.error,
			r = t.options || {};
		switch (s && (s.callFunc = "events::processsEventService", t.onCustomError("事件服务解包失败",
			"EVENT_SERVICE_ERROR", s)), e.cmd) {
			case "pushEvent":
				if (i.isFunction(r.onpushevents)) {
					let e = {
						msgEvents: [a(n.msgEvent)]
					};
					try {
						r.onpushevents(e)
					} catch (s) {
						throw t.logger.error("userOption:onpushevents function error", s), s
					}
				}
				break;
			case "pushEvents":
				if (i.isFunction(r.onpushevents)) {
					let e = n.msgEvents,
						i = e.map(e => a(e));
					e = {
						msgEvents: i
					};
					try {
						r.onpushevents(e)
					} catch (s) {
						throw t.logger.error("userOption:onpushevents function error", s), s
					}
				}
		}
	}
}, function(e, t, n) {
	var s = n(2).fn,
		r = n(0);
	s.processProxyService = function(e) {
		let t = this,
			n = e.error;
		switch (n && (n.callFunc = "events::processProxyService", t.onCustomError("proxyService",
			"EVENT_PROXY_SERVICE_ERROR", n)), e.cmd) {
			case "onProxyMsg":
				if (r.isFunction(t.options.onProxyMsg)) {
					let n = e.content.proxyMsg || {};
					n.time && (n.time = +n.time), t.options.onProxyMsg(n)
				}
				break;
			case "httpProxy":
				e.obj = e.content && e.content.proxyTag
		}
	}
}, function(e, t, n) {
	var s = n(0),
		r = function(e) {
			this.account = e.account
		},
		i = r.prototype,
		o = i.Message = n(15),
		a = i.TextMessage = n(144),
		c = i.FileMessage = n(31),
		m = i.GeoMessage = n(148),
		u = i.NotificationMessage = n(149),
		l = i.CustomMessage = n(150),
		d = i.TipMessage = n(151),
		p = i.RobotMessage = n(152),
		g = i.G2Message = n(153);
	i.validScenes = o.validScenes, i.validTypes = o.validTypes, i.sceneMap = o.sceneMap, i.sceneReverseMap =
		o.sceneReverseMap, i.reverse = function(e) {
			var t;
			switch (o.getType(e)) {
				case "text":
					t = a.reverse(e);
					break;
				case "image":
				case "audio":
				case "video":
				case "file":
					t = c.reverse(e);
					break;
				case "geo":
					t = m.reverse(e);
					break;
				case "notification":
					t = u.reverse(e);
					break;
				case "custom":
					t = l.reverse(e);
					break;
				case "tip":
					t = d.reverse(e);
					break;
				case "g2":
					t = g.reverse(e);
					break;
				case "robot":
					t = p.reverse(e);
					break;
				default:
					t = o.reverse(e)
			}
			return o.setExtra(t, this.account), t
		}, i.reverseMsgs = function(e, t) {
			var n, r, i = this;
			return e.map((function(e) {
				return e = i.reverse(e), t && ((n = t.modifyObj) && (e = s.merge(e, n)), r = t
					.mapper, s.isFunction(r) && (e = r(e))), e
			}))
		}, e.exports = r
}, function(e, t, n) {
	var s = n(15),
		r = n(0);

	function i(e) {
		r.verifyOptions(e, "text", "msg::TextMessage"), e.type = "text", s.call(this, e)
	}
	i.prototype = Object.create(s.prototype), i.reverse = function(e) {
		return s.reverse(e)
	}, e.exports = i
}, function(e, t, n) {
	n(0);
	var s = n(31);

	function r() {}
	r.prototype = Object.create(s.prototype), r.verifyFile = function(e, t) {
		return !0
	}, e.exports = r
}, function(e, t, n) {
	var s = n(31),
		r = n(0);

	function i() {}
	i.prototype = Object.create(s.prototype), i.verifyFile = function(e, t) {
		r.verifyOptions(e, "dur", !0, "file.", t)
	}, e.exports = i
}, function(e, t, n) {
	var s = n(31),
		r = n(0);

	function i() {}
	i.prototype = Object.create(s.prototype), i.verifyFile = function(e, t) {
		r.verifyOptions(e, "dur w h", !0, "file.", t)
	}, e.exports = i
}, function(e, t, n) {
	var s = n(15),
		r = n(0);

	function i(e) {
		e.type = "geo", r.verifyOptions(e, "geo", "msg::GeoMessage"), r.verifyOptions(e.geo,
				"lng lat title", !0, "geo.", "msg::GeoMessage"), r.verifyParamType("geo.lng", e.geo.lng,
				"number", "msg::GeoMessage"), r.verifyParamType("geo.lat", e.geo.lat, "number",
				"msg::GeoMessage"), r.verifyParamType("geo.title", e.geo.title, "string",
			"msg::GeoMessage"), s.call(this, e), this.attach = JSON.stringify(e.geo)
	}
	i.prototype = Object.create(s.prototype), i.reverse = function(e) {
		var t = s.reverse(e);
		return e.attach = e.attach ? "" + e.attach : "", t.geo = e.attach ? JSON.parse(e.attach) : {}, t
	}, e.exports = i
}, function(e, t, n) {
	var s = n(0).notundef,
		r = n(15),
		i = n(19).IM,
		o = n(25),
		a = n(30),
		c = {
			0: "addTeamMembers",
			1: "removeTeamMembers",
			2: "leaveTeam",
			3: "updateTeam",
			4: "dismissTeam",
			5: "passTeamApply",
			6: "transferTeam",
			7: "addTeamManagers",
			8: "removeTeamManagers",
			9: "acceptTeamInvite",
			10: "updateTeamMute",
			101: "netcallMiss",
			102: "netcallBill",
			103: "netcallReject",
			401: "addSuperTeamMembers",
			402: "removeSuperTeamMembers",
			403: "leaveSuperTeam",
			404: "updateSuperTeam",
			405: "dismissSuperTeam",
			406: "transferSuperTeam",
			407: "addSuperTeamManagers",
			408: "removeSuperTeamManagers",
			409: "updateSuperTeamMembersMute",
			410: "passSuperTeamApply",
			411: "acceptSuperTeamInvite"
		};

	function m() {}
	m.prototype = Object.create(r.prototype), m.reverse = function(e) {
		var t = r.reverse(e);
		if (e.attach = e.attach ? "" + e.attach : "", e.attach) {
			var n = JSON.parse(e.attach);
			if (t.attach = {
					type: c[n.id] || n.id
				}, s(n.data)) {
				var m = n.data;
				s(m.tinfo) && (t.attach.team = o.reverse(i.syncUnserialize(m.tinfo, "team"), !0)), s(m
						.ids) && (t.attach.accounts = m.ids), s(m.id) && (t.attach.account = m.id), s(m
						.uinfos) && (t.attach.users = m.uinfos.map((function(e) {
						return a.reverse(i.syncUnserialize(e, "user"))
					}))), s(m.mute) && (t.attach.mute = 1 == +m.mute), s(m.attach) && (t.attach.custom =
						m.attach), s(m.channel) && (t.attach.channelId = m.channel), s(m.calltype) && (t
						.attach.netcallType = m.calltype), s(m.duration) && (t.attach.duration = m
						.duration), s(m.time) && (t.attach.time = m.time), s(m.from) && (t.attach.from =
						m.from), s(m.ext) && (t.attach.ext = m.ext), t.attach.accounts && t.attach
					.accounts.length <= 2 && t.from === t.to && t.attach.accounts.some(e => {
						if (e !== t.to) return t.to = e, !0
					})
			}
		} else t.attach = {};
		return t
	}, e.exports = m
}, function(e, t, n) {
	var s = n(15),
		r = n(0);

	function i(e) {
		r.verifyOptions(e, "content", "msg::CustomMessage"), e.type = "custom", s.call(this, e), this
			.attach = e.content
	}
	i.prototype = Object.create(s.prototype), i.reverse = function(e) {
		var t = s.reverse(e);
		return t.content = e.attach, t
	}, e.exports = i
}, function(e, t, n) {
	var s = n(15),
		r = n(0);

	function i(e) {
		r.verifyOptions(e, "tip", "msg::TipMessage"), e.type = "tip", s.call(this, e), this.body = e.tip
	}
	i.prototype = Object.create(s.prototype), i.reverse = function(e) {
		var t = s.reverse(e);
		return t.text = "", t.tip = e.body, e.attach && (t.attach = e.attach), t
	}, e.exports = i
}, function(e, t, n) {
	const s = n(15),
		r = n(0),
		i = {
			welcome: "00",
			text: "01",
			link: "03"
		},
		o = {
			"01": "text",
			"02": "image",
			"03": "answer",
			11: "template"
		};

	function a(e) {
		r.verifyOptions(e, "content", "msg::RobotMessage"), r.undef(e.robotAccid) && (e.robotAccid = e.to);
		let t = e.content;
		switch (t.type) {
			case "welcome":
				r.undef(e.body) && (this.body = "欢迎消息");
				break;
			case "text":
				r.verifyOptions(t, "content", "msg::RobotMessage"), r.undef(e.body) && (this.body = t
					.content);
				break;
			case "link":
				r.verifyOptions(t, "target", "msg::RobotMessage")
		}
		t.type && (t.type = i[t.type]), t = {
			param: t,
			robotAccid: e.robotAccid
		}, this.attach = JSON.stringify(t), e.type = "robot", s.call(this, e)
	}
	a.prototype = Object.create(s.prototype), a.reverse = function(e) {
		var t = s.reverse(e);
		if ("robot" === t.type) {
			let n = JSON.parse(e.attach);
			if (n.param && (n.param.type = o[n.param.type] || "unknown"), n.robotMsg) {
				n = r.merge(n, n.robotMsg);
				let e = n.message;
				"bot" === n.flag ? n.message = e.map(e => (e.type = o[e.type] || "unknown", e)) : n
					.flag, delete n.robotMsg
			}
			t.content = n
		}
		return t
	}, e.exports = a
}, function(e, t, n) {
	var s = n(15),
		r = n(0);

	function i(e) {
		r.verifyOptions(e, "attach", "msg::G2Message"), e.type = "g2", s.call(this, e), this.attach = JSON
			.stringify(e.attach)
	}
	i.prototype = Object.create(s.prototype), i.reverse = function(e) {
		var t = s.reverse(e);
		return e.attach && (t.attach = JSON.parse(e.attach)), t
	}, e.exports = i
}, function(e, t, n) {
	var s = n(3).fn,
		r = n(0),
		i = r.isArray,
		o = n(20);
	s.mergeObjArray = function(e, t, n) {
			return e || (e = []), t ? (i(t) || (t = [t]), t.length ? (n = n || {}, r.mergeObjArray(e, t,
				n)) : e) : e
		}, s.cutObjArray = function(e, t, n) {
			return e && t ? (i(t) || (t = [t]), t.length ? (n = n || {}, r.cutObjArray(e, t, n)) : e) : e
		}, s.mergeLoginPorts = function(e, t) {
			return this.mergeObjArray(e, t, {
				keyPath: "deviceId"
			})
		}, s.cutLoginPorts = function(e, t) {
			return this.cutObjArray(e, t, {
				keyPath: "deviceId",
				sortPath: "type"
			})
		}, s.mergeRelations = function(e, t) {
			return this.mergeObjArray(e, t, {
				keyPath: "account"
			})
		}, s.cutRelations = function(e, t) {
			return this.cutObjArray(e, t, {
				keyPath: "account"
			})
		}, s.findRelation = function(e, t) {
			return r.findObjInArray(e, {
				keyPath: "account",
				value: t
			})
		}, s.mergeFriends = function(e, t) {
			return this.mergeObjArray(e, t, {
				keyPath: "account"
			})
		}, s.cutFriends = function(e, t) {
			return this.cutObjArray(e, t, {
				keyPath: "account"
			})
		}, s.cutFriendsByAccounts = function(e, t) {
			i(t) || (t = [t]);
			var n = t.map((function(e) {
				return {
					account: e
				}
			}));
			return this.cutFriends(e, n)
		}, s.findFriend = function(e, t) {
			return r.findObjInArray(e, {
				keyPath: "account",
				value: t
			})
		}, s.mergeUsers = function(e, t) {
			return this.mergeObjArray(e, t, {
				keyPath: "account"
			})
		}, s.findUser = function(e, t) {
			return r.findObjInArray(e, {
				keyPath: "account",
				value: t
			})
		}, s.mergeTeams = function(e, t) {
			return this.mergeObjArray(e, t, {
				keyPath: "teamId"
			})
		}, s.cutTeams = function(e, t) {
			return this.cutObjArray(e, t, {
				keyPath: "teamId"
			})
		}, s.findTeam = function(e, t) {
			return r.findObjInArray(e, {
				keyPath: "teamId",
				value: t
			})
		}, s.assembleTeamOwner = o.assembleOwner, s.assembleTeamMembers = o.assembleMembers, s
		.genTeamMemberId = o.genId, s.mergeTeamMembers = function(e, t) {
			return this.mergeObjArray(e, t)
		}, s.cutTeamMembers = function(e, t) {
			return this.cutObjArray(e, t)
		}, s.cutTeamMembersByAccounts = function(e, t, n) {
			i(n) || (n = [n]);
			var s = o.assembleMembers({
				teamId: t
			}, n);
			return this.cutTeamMembers(e, s)
		}, s.findTeamMember = function(e, t) {
			return r.findObjInArray(e, {
				keyPath: "id",
				value: t
			})
		}, s.mergeSessions = function(e, t) {
			return this.mergeObjArray(e, t, {
				sortPath: "updateTime",
				desc: !0
			})
		}, s.cutSessions = function(e, t) {
			return this.cutObjArray(e, t)
		}, s.cutSessionsByIds = function(e, t) {
			i(t) || (t = [t]);
			var n = t.map((function(e) {
				return {
					id: e
				}
			}));
			return this.cutSessions(e, n)
		}, s.findSession = function(e, t) {
			return r.findObjInArray(e, {
				keyPath: "id",
				value: t
			})
		}, s.mergeMsgs = function(e, t) {
			return this.mergeObjArray(e, t, {
				keyPath: "idClient",
				sortPath: "time"
			})
		}, s.cutMsgs = function(e, t) {
			return this.cutObjArray(e, t, {
				keyPath: "idClient"
			})
		}, s.cutMsgsByIdClients = function(e, t) {
			i(t) || (t = [t]);
			var n = t.map((function(e) {
				return {
					idClient: e
				}
			}));
			return this.cutMsgs(e, n)
		}, s.findMsg = function(e, t) {
			return r.findObjInArray(e, {
				keyPath: "idClient",
				value: t
			})
		}, s.mergeSysMsgs = function(e, t) {
			return this.mergeObjArray(e, t, {
				keyPath: "idServer",
				desc: !0
			})
		}, s.cutSysMsgs = function(e, t) {
			return this.cutObjArray(e, t, {
				keyPath: "idServer"
			})
		}, s.cutSysMsgsByIdServers = function(e, t) {
			i(t) || (t = [t]);
			var n = t.map((function(e) {
				return {
					idServer: e
				}
			}));
			return this.cutSysMsgs(e, n)
		}, s.findSysMsg = function(e, t) {
			return r.findObjInArray(e, {
				keyPath: "idServer",
				value: t
			})
		}, s.searchLocal = function(e) {
			if (r.verifyOptions(e, "keyword", "searchLocal"), !this.db.enable) return void e.done(null, {
				sessions: [],
				users: [],
				msg: "no db"
			});
			let t, n = this,
				s = this.db,
				i = e.keyword + "",
				o = ["account", "nick", "alias"],
				a = ["id", "scene", "lastMsg.type", "lastMsg.text", "localCustom", "target.account",
					"target.nick", "target.alias", "target.name"
				],
				c = "",
				m = e.keyPath;
			switch (m ? (m = (m + "").split("."), c = m.shift(), m = m.join(".")) : c = "all", c) {
				case "user":
					m && (o = o.filter(e => e === m || 0 === e.indexOf(m + "."))), l(o).then(t => {
						e.done(null, {
							sessions: [],
							users: t
						})
					});
					break;
				case "session":
					m && (a = a.filter(e => e === m || 0 === e.indexOf(m + "."))), u(a, !m || m.indexOf(
						"target") > -1).then(t => {
						e.done(null, {
							sessions: t,
							users: []
						})
					});
					break;
				case "all":
					d().then(() => {
						Promise.all([u(a, !0), l(o)]).then(t => {
							e.done(null, {
								sessions: t[0],
								users: t[1]
							})
						})
					});
					break;
				default:
					e.done(null, {
						sessions: [],
						users: [],
						msg: 'keyPath must start with "user" or "session"'
					})
			}
			async function u(e, t) {
				let n = t ? [s.getSessions(), d(), s.getTeams(), s.getSuperTeams()] : [s.getSessions()];
				return Promise.all(n).then(n => {
					let s = n[0] || [],
						r = {
							p2p: n[1] || [],
							team: n[2] || [],
							superTeam: n[3] || []
						},
						i = {};
					return t && (Object.keys(r).forEach(e => {
						r[e].forEach(t => {
							let n = t.teamId || t.account;
							i[e + "-" + n] = t
						})
					}), s.forEach(e => {
						e.target = i[e.id]
					})), p(e, s)
				})
			}
			async function l(e) {
				return p(e, await d())
			}
			async function d() {
				if (t) return t;
				let e = await n.db.getFriends() || [],
					s = n.protocol.userSet || {};
				return t = e.map(e => ({
					...e,
					...s[e.account]
				})), t
			}

			function p(e, t) {
				let n = [];
				return t.forEach(t => {
					for (let s = 0; s < e.length; s++) {
						let r = g(t, e[s].split("."));
						if (r && r.indexOf(i) > -1) {
							n.push(Object.assign({}, t));
							break
						}
					}
				}), n
			}

			function g(e, t) {
				if ("object" == typeof e && e) return 1 === t.length ? e[t[0]] : g(e[t.shift()], t)
			}
		}
}, function(e, t, n) {
	var s = n(3).fn,
		r = n(0);
	s.kick = function(e) {
		r.verifyOptions(e, "deviceIds", "link::kick"), this.processCallback(e), this.sendCmd("kick", {
			deviceIds: e.deviceIds.slice(0)
		}, e.callback)
	}
}, function(e, t, n) {
	var s = n(3).fn,
		r = n(0);
	s.markInBlacklist = function(e) {
		r.verifyOptions(e, "account isAdd", "relation::markInBlacklist"), r.verifyParamType("isAdd", e
			.isAdd, "boolean", "relation::markInBlacklist"), this.processCallback(e), this.sendCmd(
			"markInBlacklist", {
				account: e.account,
				isAdd: e.isAdd
			}, e.callback)
	}, s.addToBlacklist = function(e) {
		return e.isAdd = !0, this.markInBlacklist(e)
	}, s.removeFromBlacklist = function(e) {
		return e.isAdd = !1, this.markInBlacklist(e)
	}, s.markInMutelist = function(e) {
		r.verifyOptions(e, "account", "relation::markInMutelist"), r.verifyParamType("isAdd", e.isAdd,
			"boolean", "relation::markInMutelist"), this.processCallback(e), this.sendCmd(
			"markInMutelist", {
				account: e.account,
				isAdd: e.isAdd
			}, e.callback)
	}, s.addToMutelist = function(e) {
		return e.isAdd = !0, this.markInMutelist(e)
	}, s.removeFromMutelist = function(e) {
		return e.isAdd = !1, this.markInMutelist(e)
	}, s.getRelations = function(e) {
		var t = this,
			n = t.db,
			s = 0;

		function i() {
			t.sendCmd("getRelations", {
				timetag: s,
				NOTSTORE: "timetag"
			}, e.callback)
		}
		e = r.verifyOptions(e), t.processCallback(e), n.enable ? n.getRelationsTimetag().then((function(
			e) {
			s = e, i()
		}), i) : i()
	}
}, function(e, t, n) {
	var s = n(3).fn,
		r = n(0),
		i = r.objs2accounts,
		o = n(30);
	s.updateMyInfo = function(e) {
		r.verifyOptions(e), this.processCallback(e), e.user = new o(e), delete e.user.account, this
			.sendCmd("updateMyInfo", {
				user: e.user,
				antispamTag: {
					antiSpamBusinessId: e.antiSpamBusinessId
				},
				single: !0
			}, e.callback)
	}, s.getMyInfo = function(e) {
		return (e = e || {}).account = this.account, this.getUser(e)
	}, s.getUser = function(e) {
		var t, n = this,
			s = n.db;

		function i() {
			n.sendCmd("getUsers", {
				accounts: [t],
				single: !0
			}, e.callback)
		}
		r.verifyOptions(e, "account", "user::getUser"), n.processCallback(e), e.cbaop = function(e, s) {
			if (!e) return s = s[0] || null, n.logger.info("api::getUser: cbaop " + t), s
		}, t = e.account, e.sync ? i() : s.enable ? s.getUser(t).then((function(t) {
			t ? e.done(null, t) : i()
		}), i) : i()
	}, s.getUsers = function(e) {
		var t, n = this,
			s = n.db,
			o = [];

		function a() {
			n.sendCmd("getUsers", {
				accounts: t,
				single: !0
			}, e.callback)
		}
		r.verifyOptions(e, "accounts", "user::getUsers"), r.verifyParamType("accounts", e.accounts,
			"array", "user::getUsers"), n.processCallback(e), e.cbaop = function(e, s) {
			if (!e) return s = s.concat(o), n.logger.info("api::getUsers: cbaop " + t), s
		}, t = r.deduplicate(e.accounts), r.verifyArrayMax("accounts", e.accounts, 150,
			"user::getUsers"), e.sync ? a() : s.enable ? s.getUsers(t).then((function(n) {
			if (n && n.length === t.length) e.done(null, n);
			else {
				o = n;
				var s = i(n),
					r = [];
				t.forEach((function(e) {
					-1 === s.indexOf(e) && r.push(e)
				})), t = r, a()
			}
		}), a) : a()
	}
}, function(e, t, n) {
	var s = n(3).fn,
		r = n(0),
		i = r.notundef,
		o = n(93);
	s.friendRequest = function(e) {
		r.verifyOptions(e, "type account", "friend::friendRequest"), r.verifyParamValid("type", e.type,
			o.validTypes(), "friend::friendRequest"), this.processPs(e), this.processCallback(e);
		var t = {
			account: e.account,
			type: o.getByteFromType(e.type),
			ps: e.ps
		};
		i(e.idServer) && (t.idServer = e.idServer), this.sendCmd("friendRequest", t, e.callback)
	}, s.addFriend = function(e) {
		e.type = "addFriend", this.friendRequest(e)
	}, s.applyFriend = function(e) {
		e.type = "applyFriend", this.friendRequest(e)
	}, s.passFriendApply = function(e) {
		r.verifyOptions(e, "idServer", "friend::passFriendApply"), e.type = "passFriendApply", this
			.friendRequest(e)
	}, s.rejectFriendApply = function(e) {
		r.verifyOptions(e, "idServer", "friend::rejectFriendApply"), e.type = "rejectFriendApply", this
			.friendRequest(e)
	}, s.deleteFriend = function(e) {
		r.verifyOptions(e, "account", "friend::deleteFriend");
		var t = !0 === e.delAlias;
		this.processCallback(e), this.sendCmd("deleteFriend", {
			account: e.account,
			delFriendParams: {
				delAlias: t ? 1 : 0
			}
		}, e.callback)
	}, s.updateFriend = function(e) {
		this.processCallback(e);
		var t = new o(e);
		this.sendCmd("updateFriend", {
			friend: t,
			single: !0
		}, e.callback)
	}, s.getFriends = function(e) {
		var t = this.db;
		r.validate({
			timetag: {
				type: "number",
				required: !1
			}
		}, e, "friend::getFriends"), this.processCallback(e), t.enable ? t.getFriends({
			updateTime: e.updateTime || 0
		}).then((function(t) {
			(t = t.sort((function(e, t) {
				return e.updateTime - t.updateTime
			}))).invalid = [], e.done(null, t)
		})) : this.sendCmd("getFriends", {
			timetag: e.updateTime || 0,
			NOTSTORE: "timetag"
		}, e.callback)
	}, s.isMyFriend = function(e) {
		var t = this.db;
		r.validate({
			account: {
				type: "string",
				allowEmpty: !1,
				require: !0
			}
		}, e), this.processCallback(e), t.enable || e.done(null, !1), t.getFriend(e.account).then(
			t => {
				t && !0 === t.valid ? e.done(null, !0) : e.done(null, !1)
			})
	}, s.isUserInBlackList = function(e) {
		var t = this.db;
		r.validate({
			account: {
				type: "string",
				allowEmpty: !1,
				require: !0
			}
		}, e), this.processCallback(e), t.enable || e.done(null, !1), t.getUserFromBlackList(e
			.account).then(t => {
			t && t.account ? e.done(null, !0) : e.done(null, !1)
		})
	}
}, function(e, t, n) {
	n(3).fn.getRobots = function(e) {
		this.logger.warn("this api will be abandon"), (e = e || {}).type = "getRobots", this
			.processCallback(e), this.sendCmd("sync", {
				sync: {
					robots: 0
				}
			}, e.callback)
	}
}, function(e, t, n) {
	var s = n(3).fn,
		r = n(0),
		i = r.undef,
		o = n(25),
		a = n(20);
	s.createTeam = function(e) {
		r.verifyOptions(e, "type name", "team::createTeam"), i(e.accounts) ? e.accounts = [] : r
			.verifyParamType("accounts", e.accounts, "array", "team::createTeam"), e.action = "create",
			this.processPs(e), this.processCallback(e), e.team = new o(e);
		var t = {
			team: e.team,
			accounts: e.accounts.slice(0),
			ps: e.ps,
			antispamTag: {
				antiSpamBusinessId: e.antiSpamBusinessId
			}
		};
		this.sendCmd("createTeam", t, e.callback)
	}, s.updateTeam = function(e) {
		r.verifyOptions(e, "teamId", "team::updateTeam"), e.action = "update", this.processCallback(e),
			e.team = new o(e), this.sendCmd("updateTeam", {
				team: e.team,
				antispamTag: {
					antiSpamBusinessId: e.antiSpamBusinessId
				},
				single: !0
			}, e.callback)
	}, s.addTeamMembers = function(e) {
		r.verifyOptions(e, "teamId accounts", "team::addTeamMembers"), r.verifyParamType("accounts", e
				.accounts, "array", "team::addTeamMembers"), this.processPs(e), r.notexist(e.custom) &&
			(e.custom = ""), this.processCallback(e);
		var t = {
			teamId: e.teamId,
			accounts: e.accounts.slice(0),
			ps: e.ps,
			attach: e.custom
		};
		this.sendCmd("addTeamMembers", t, e.callback)
	}, s.removeTeamMembers = function(e) {
		r.verifyOptions(e, "teamId accounts", "team::removeTeamMembers"), r.verifyParamType("accounts",
			e.accounts, "array", "team::removeTeamMembers"), this.processCallback(e);
		var t = {
			teamId: e.teamId,
			accounts: e.accounts.slice(0)
		};
		this.sendCmd("removeTeamMembers", t, e.callback)
	}, s.acceptTeamInvite = function(e) {
		r.verifyOptions(e, "idServer teamId from", "team::acceptTeamInvite"), this.processCallback(e);
		var t = {
			idServer: e.idServer,
			teamId: e.teamId,
			from: e.from
		};
		this.sendCmd("acceptTeamInvite", t, e.callback)
	}, s.rejectTeamInvite = function(e) {
		r.verifyOptions(e, "idServer teamId from", "team::rejectTeamInvite"), this.processPs(e), this
			.processCallback(e);
		var t = {
			idServer: e.idServer,
			teamId: e.teamId,
			from: e.from,
			ps: e.ps
		};
		this.sendCmd("rejectTeamInvite", t, e.callback)
	}, s.applyTeam = function(e) {
		r.verifyOptions(e, "teamId", "team::applyTeam"), this.processPs(e), this.processCallback(e);
		var t = {
			teamId: e.teamId,
			ps: e.ps
		};
		this.sendCmd("applyTeam", t, e.callback)
	}, s.passTeamApply = function(e) {
		r.verifyOptions(e, "idServer teamId from", "team::passTeamApply"), this.processCallback(e);
		var t = {
			idServer: e.idServer,
			teamId: e.teamId,
			from: e.from
		};
		this.sendCmd("passTeamApply", t, e.callback)
	}, s.rejectTeamApply = function(e) {
		r.verifyOptions(e, "idServer teamId from", "team::rejectTeamApply"), this.processPs(e), this
			.processCallback(e);
		var t = {
			idServer: e.idServer,
			teamId: e.teamId,
			from: e.from,
			ps: e.ps
		};
		this.sendCmd("rejectTeamApply", t, e.callback)
	}, s.addTeamManagers = function(e) {
		r.verifyOptions(e, "teamId accounts", "team::addTeamManagers"), r.verifyParamType("accounts", e
			.accounts, "array", "team::addTeamManagers"), this.processCallback(e);
		var t = {
			teamId: e.teamId,
			accounts: e.accounts.slice(0)
		};
		this.sendCmd("addTeamManagers", t, e.callback)
	}, s.removeTeamManagers = function(e) {
		r.verifyOptions(e, "teamId accounts", "team::removeTeamManagers"), r.verifyParamType("accounts",
			e.accounts, "array", "team::removeTeamManagers"), this.processCallback(e);
		var t = {
			teamId: e.teamId,
			accounts: e.accounts.slice(0)
		};
		this.sendCmd("removeTeamManagers", t, e.callback)
	}, s.updateInfoInTeam = function(e) {
		r.verifyOptions(e, "teamId", "team::updateInfoInTeam"), this.processCallback(e), this.sendCmd(
			"updateInfoInTeam", {
				teamMember: new a(e),
				single: !0
			}, e.callback)
	}, s.updateNickInTeam = function(e) {
		r.verifyOptions(e, "teamId account", "team::updateNickInTeam"), this.processCallback(e), this
			.sendCmd("updateNickInTeam", {
				teamMember: new a(e),
				single: !0
			}, e.callback)
	}, s.updateMuteStateInTeam = function(e) {
		r.verifyOptions(e, "teamId account mute", "team::updateMuteStateInTeam"), this.processCallback(
			e), e.mute = e.mute ? 1 : 0, this.sendCmd("updateMuteStateInTeam", e)
	}, s.getMutedTeamMembers = function(e) {
		r.verifyOptions(e, "teamId", "team::getMutedTeamMembers"), this.processCallback(e), this
			.sendCmd("getMutedTeamMembers", e)
	}, s.leaveTeam = function(e) {
		r.verifyOptions(e, "teamId", "team::leaveTeam"), this.processCallback(e);
		var t = {
			teamId: e.teamId
		};
		this.sendCmd("leaveTeam", t, e.callback)
	}, s.transferTeam = function(e) {
		r.verifyOptions(e, "teamId account leave", "team::transferTeam"), r.verifyParamType("leave", e
			.leave, "boolean", "team::transferTeam"), this.processCallback(e);
		var t = {
			teamId: e.teamId,
			account: e.account,
			leave: e.leave
		};
		this.sendCmd("transferTeam", t, e.callback)
	}, s.dismissTeam = function(e) {
		r.verifyOptions(e, "teamId", "team::dismissTeam"), this.processCallback(e);
		var t = {
			teamId: e.teamId
		};
		this.sendCmd("dismissTeam", t, e.callback)
	}, s.getTeam = function(e) {
		var t, n = this,
			s = n.db;

		function i() {
			n.sendCmd("getTeam", {
				teamId: e.teamId
			}, e.callback)
		}
		r.verifyOptions(e, "teamId", "team::getTeam"), n.processCallback(e), e.cbaop = function(e, s) {
			e || n.logger.info("api::getTeam: cbaop " + t)
		}, t = e.teamId, s.enable && !e.sync ? s.getTeam(t).then((function(s) {
			s && s.validToCurrentUser ? (n.logger.log("api::getTeam: db.getTeam " + t), e
				.done(null, s)) : i()
		}), i) : i()
	}, s.getTeams = function(e) {
		var t = this,
			n = t.db,
			s = 0;

		function i() {
			t.sendCmd("getTeams", {
				timetag: s,
				NOTSTORE: "timetag"
			}, e.callback)
		}
		r.verifyOptions(e), t.processCallback(e), n.enable ? n.getTeamsTimetag().then((function(e) {
			s = e, i()
		}), i) : i()
	}, s.getTeamsById = function(e) {
		r.verifyOptions(e, "teamIds", "teams::getTeamsById"), this.processCallback(e), this.sendCmd(
			"getTeamsById", {
				teamIds: e.teamIds
			}, e.callback)
	}, s.getTeamMembers = function(e) {
		var t = this;
		r.verifyOptions(e, "teamId", "team::getTeamMembers"), t.processCallback(e), t.sendCmd(
			"getTeamMembers", {
				teamId: e.teamId,
				timetag: 0,
				NOTSTORE: "timetag"
			}, e.callback)
	}, s.getTeamMemberByTeamIdAndAccount = function(e) {
		var t = this;
		r.verifyParamType("teamId", e.teamId, "numeric or numeric string",
			"team::getTeamMemberByTeamIdAndAccount"), r.verifyOptions(e, "account",
			"team::getTeamMemberByTeamIdAndAccount"), t.processCallback(e), t.sendCmd(
			"getTeamMembers", {
				teamId: e.teamId,
				timetag: 0,
				NOTSTORE: "timetag"
			}, (function(t, n, s) {
				var r = {};
				if (n && n.members && n.members.length)
					for (var i = 0; i < n.members.length; i++)
						if (n.members[i].account === e.account) {
							r[e.account] = n.members[i];
							break
						} e.callback(t, r, s)
			}))
	}, s.getTeamMemberInvitorAccid = function(e) {
		r.verifyParamType("teamId", e.teamId, "numeric or numeric string",
			"team::getTeamMemberInvitorAccid"), i(e.accounts) || (r.verifyParamType("accounts", e
				.accounts, "array", "team::getTeamMemberInvitorAccid"), e.accounts.length > 200 && r
			.onParamError("accounts 参数数组长度不能超过200", "team::getTeamMemberInvitorAccid"));
		var t = {
			teamId: e.teamId
		};
		e.accounts.length && (t.accounts = e.accounts.slice(0)), this.processCallback(e), this.sendCmd(
			"getTeamMemberInvitorAccid", t, (function(t, n, s) {
				e.callback(t, s && s.accountsMap || {})
			}))
	}, s.notifyForNewTeamMsg = function(e) {
		r.verifyOptions(e, "teamIds", "team::notifyForNewTeamMsg"), this.protocol.notifyForNewTeamMsg(e
			.teamIds).then((function(t) {
			e.done(t.error || null, t.map, t.miss)
		}), (function(t) {
			e.done(t)
		}))
	}, s.getMyTeamMembers = function(e) {
		r.verifyOptions(e, "teamIds", "team::getMyTeamMembers");
		var t = this.processCallbackPromise(e);
		return this.sendCmd("getMyTeamMembers", e), t
	}, s.getLocalTeams = function(e) {
		var t, n = this.db,
			s = [];

		function i() {
			e.teams = s, e.done(t, e)
		}
		r.verifyOptions(e, "teamIds", "team::getLocalTeams"), r.verifyParamType("teamIds", e.teamIds,
				"array", "team::getLocalTeams"), this.processCallback(e), n.enable ? n
			.getTeamsByTeamIds(e.teamIds).then((function(e) {
				s = e.filter((function(e) {
					return !!e
				})), i()
			}), (function(e) {
				t = e, i()
			})) : i()
	}, s.getLocalTeamMembers = function(e) {
		var t, n = this.db,
			s = [];

		function i() {
			e.members = s, e.done(t, e)
		}
		r.verifyOptions(e, "teamId accounts", "team::getLocalTeamMembers"), r.verifyParamType(
				"accounts", e.accounts, "array", "team::getLocalTeamMembers"), this.processCallback(e),
			n.enable ? n.getInvalidTeamMembers(e.teamId, e.accounts).then((function(e) {
				s = e.filter((function(e) {
					return !!e
				})), i()
			}), (function(e) {
				t = e, i()
			})) : i()
	}, s.deleteLocalTeam = function(e) {
		var t, n = this.db;

		function s() {
			e.done(t, e)
		}
		r.verifyOptions(e, "teamId", "team::deleteLocalTeam"), this.processCallback(e), n.enable ? n
			.deleteTeam(e.teamId).then((function() {
				s()
			}), (function(e) {
				t = e, s()
			})) : s()
	}, s.muteTeamAll = function(e) {
		r.verifyOptions(e, "teamId mute", "team::muteTeamAll"), e.mute = e.mute ? 1 : 0, this
			.processCallback(e), this.sendCmd("muteTeamAll", e)
	}, s.sendTeamMsgReceipt = function(e) {
		r.verifyOptions(e, "teamMsgReceipts", "team::sendTeamMsgReceipt"), e.teamMsgReceipts.length >
			50 ? this.logger.error("team::sendTeamMsgReceipt：teamMsgReceipts length over 50") : (this
				.processCallback(e), this.sendCmd("sendTeamMsgReceipt", e))
	}, s.getTeamMsgReads = function(e) {
		r.verifyOptions(e, "teamMsgReceipts", "team::getTeamMsgReads"), this.processCallback(e), this
			.sendCmd("getTeamMsgReads", e)
	}, s.getTeamMsgReadAccounts = function(e) {
		var t = this;
		let n;
		r.verifyOptions(e, "teamMsgReceipt", "team::getTeamMsgReadAccounts"), e.callback = function(t,
			s, r) {
			t && n ? (s = s || {
				teamMsgReceipt: e.teamMsgReceipt
			}, e.done(t, s, {
				teamMsgReceipt: e.teamMsgReceipt,
				unreadAccounts: n.unreadAccounts,
				readAccounts: n.readAccounts
			})) : e.done(t, s, r)
		}, this.db.enable && e.teamMsgReceipt.idClient ? this.db.getMsgReadDetail(e.teamMsgReceipt
			.idClient).then(s => {
			if (n = s, !s) return Promise.reject("no record");
			if (s.unreadAccounts && s.unreadAccounts.length > 0) return Promise.reject(
				"unreadAccounts.length > 0");
			const r = {
				teamMsgReceipt: e.teamMsgReceipt,
				unreadAccounts: s.unreadAccounts,
				readAccounts: s.readAccounts
			};
			t.logger.info("getTeamMsgReadAccounts from db"), e.done(null, {
				teamMsgReceipt: e.teamMsgReceipt
			}, r)
		}).catch(n => {
			this.logger.warn("db.getMsgReadDetail invalid", n), t.sendCmd(
				"getTeamMsgReadAccounts", e)
		}) : t.sendCmd("getTeamMsgReadAccounts", e)
	}
}, function(e, t, n) {
	var s = n(3).fn,
		r = n(0),
		i = r.undef,
		o = n(50),
		a = n(29);

	function c(e) {
		var t = this.db;
		if (!t.enable) return Promise.resolve({
			valid: !1
		});
		var n = t.getSuperTeam(e),
			s = t.getSuperTeamMembersTimetag(e);
		return Promise.all([n, s]).then(([e, t]) => {
			var n = e && e.memberUpdateTime,
				s = {
					timetag: t = t || 0
				};
			return n && t >= n && (s.valid = !0), Promise.resolve(s)
		}).catch(() => Promise.resolve({
			timetag: 0
		}))
	}
	s.addSuperTeamMembers = function(e) {
		r.verifyOptions(e, "teamId accounts", "superTeam::addSuperTeamMembers"), r.verifyParamType(
			"accounts", e.accounts, "array", "superTeam::addSuperTeamMembers");
		var t = r.deduplicate(e.accounts);
		this.processPs(e), this.processCallback(e);
		var n = {
			teamId: e.teamId,
			accounts: t,
			ps: e.ps
		};
		this.sendCmd("addSuperTeamMembers", n, e.callback)
	}, s.removeSuperTeamMembers = function(e) {
		r.verifyOptions(e, "teamId accounts", "team::removeSuperTeamMembers"), r.verifyParamType(
			"accounts", e.accounts, "array", "team::removeSuperTeamMembers");
		var t = r.deduplicate(e.accounts);
		this.processCallback(e);
		var n = {
			teamId: e.teamId,
			accounts: t
		};
		this.sendCmd("removeSuperTeamMembers", n, e.callback)
	}, s.leaveSuperTeam = function(e) {
		r.verifyOptions(e, "teamId", "superTeam::leaveSuperTeam"), this.processCallback(e);
		var t = {
			teamId: e.teamId
		};
		this.sendCmd("leaveSuperTeam", t, e.callback)
	}, s.getSuperTeam = function(e) {
		var t, n = this,
			s = n.db;

		function i() {
			n.sendCmd("getSuperTeam", {
				teamId: e.teamId
			}, e.callback)
		}
		r.verifyOptions(e, "teamId", "team::getSuperTeam"), n.processCallback(e), e.cbaop = function(e,
			s) {
			e || n.logger.info("api::getSuperTeam: cbaop " + t)
		}, t = e.teamId, s.enable && !e.sync ? s.getSuperTeam(t).then((function(s) {
			s && s.validToCurrentUser ? (n.logger.log(
				"api::getSuperTeam: db.getSuperTeam " + t), e.done(null, s)) : i()
		})).catch(e => {
			i()
		}) : i()
	}, s.getSuperTeams = function(e) {
		var t = this,
			n = t.db,
			s = 0;

		function i() {
			t.sendCmd("getSuperTeams", {
				timetag: s,
				NOTSTORE: "timetag"
			}, e.callback)
		}
		r.verifyOptions(e), t.processCallback(e), n.enable ? n.getSuperTeamsTimetag().then((function(
		e) {
			s = e, i()
		}), i) : i()
	}, s.updateSuperTeam = function(e) {
		r.verifyOptions(e, "teamId", "superTeam::updateSuperTeam"), e.action = "update", this
			.processCallback(e), e.team = new o(e), this.sendCmd("updateSuperTeam", {
				team: e.team,
				antispamTag: {
					antiSpamBusinessId: e.antiSpamBusinessId
				},
				single: !0
			}, e.callback)
	}, s.updateInfoInSuperTeam = function(e) {
		r.verifyOptions(e, "teamId", "superTeam::updateInfoInSuperTeam"), this.processCallback(e), this
			.sendCmd("updateInfoInSuperTeam", {
				superTeamMember: new a(e),
				single: !0
			}, e.callback)
	}, s.getSuperTeamMembersByJoinTime = function(e) {
		var t = this,
			{
				joinTime: n,
				reverse: s,
				limit: o,
				teamId: a
			} = (t.db, e);
		s = !!s, i(n) && (n = 0), i(o) && (o = 100), r.verifyOptions(e, "teamId",
				"superTeam::getSuperTeamMembersByJoinTime"), r.verifyParamType("joinTime", n, "number",
				"api::superTeam::getSuperTeamMembersByJoinTime"), r.verifyParamType("limit", o,
				"number", "api::superTeam::getSuperTeamMembersByJoinTime"), t.processCallback(e), t
			.sendCmd("getSuperTeamMembersByJoinTime", {
				teamId: a,
				limit: o,
				joinTime: n,
				reverse: s,
				timetag: 0,
				NOTSTORE: "timetag"
			}, e.callback)
	}, s.getAllSuperTeamMembers = function(e) {
		var t = this,
			n = this.db;

		function s(n) {
			n = n || 0, t.sendCmd("getSuperTeamMembers", {
				teamId: e.teamId,
				timetag: n,
				NOTSTORE: "timetag"
			}, e.callback)
		}
		r.verifyOptions(e, "teamId", "superTeam::getAllSuperTeamMembers"), t.processCallback(e), c.bind(
			this)(e.teamId).then(r => {
			var {
				valid: i,
				timetag: o
			} = r;
			i ? (t.logger.info("getAllSuperTeamMembers from local db"), n.getSuperTeamMembers(e
				.teamId).then((function(t) {
				var n = {
					teamId: e.teamId,
					members: t
				};
				e.done(null, n)
			}), () => s())) : s(o)
		})
	}, s.applySuperTeam = function(e) {
		r.verifyOptions(e, "teamId", "team::applySuperTeam"), r.verifyOptions(e, "teamId",
			"team::applySuperTeam"), this.processPs(e), this.processCallback(e);
		var t = {
			teamId: e.teamId,
			ps: e.ps
		};
		this.sendCmd("applySuperTeam", t, e.callback)
	}, s.passSuperTeamApply = function(e) {
		r.verifyOptions(e, "idServer teamId from", "team::passSuperTeamApply"), this.processCallback(e);
		var t = {
			idServer: e.idServer,
			teamId: e.teamId,
			from: e.from
		};
		this.sendCmd("passSuperTeamApply", t, e.callback)
	}, s.rejectSuperTeamApply = function(e) {
		r.verifyOptions(e, "idServer teamId from", "team::rejectSuperTeamApply"), this.processPs(e),
			this.processCallback(e);
		var t = {
			idServer: e.idServer,
			teamId: e.teamId,
			from: e.from,
			ps: e.ps
		};
		this.sendCmd("rejectSuperTeamApply", t, e.callback)
	}, s.acceptSuperTeamInvite = function(e) {
		r.verifyOptions(e, "idServer teamId from", "team::acceptSuperTeamInvite"), this.processCallback(
			e);
		var t = {
			idServer: e.idServer,
			teamId: e.teamId,
			from: e.from
		};
		this.sendCmd("acceptSuperTeamInvite", t, e.callback)
	}, s.rejectSuperTeamInvite = function(e) {
		r.verifyOptions(e, "idServer teamId from", "team::rejectSuperTeamInvite"), this.processPs(e),
			this.processCallback(e);
		var t = {
			idServer: e.idServer,
			teamId: e.teamId,
			from: e.from,
			ps: e.ps
		};
		this.sendCmd("rejectSuperTeamInvite", t, e.callback)
	}, s.addSuperTeamManagers = function(e) {
		r.verifyOptions(e, "teamId accounts", "team::addSuperTeamManagers"), r.verifyParamType(
			"accounts", e.accounts, "array", "team::addSuperTeamManagers"), this.processCallback(e);
		var t = {
			teamId: e.teamId,
			accounts: e.accounts.slice(0)
		};
		this.sendCmd("addSuperTeamManagers", t, e.callback)
	}, s.removeSuperTeamManagers = function(e) {
		r.verifyOptions(e, "teamId accounts", "team::removeSuperTeamManagers"), r.verifyParamType(
			"accounts", e.accounts, "array", "team::removeSuperTeamManagers"), this.processCallback(
			e);
		var t = {
			teamId: e.teamId,
			accounts: e.accounts.slice(0)
		};
		this.sendCmd("removeSuperTeamManagers", t, e.callback)
	}, s.updateSuperTeamMembersMute = function(e) {
		r.verifyOptions(e, "teamId accounts mute", "team::updateSuperTeamMembersMute"), r
			.verifyParamType("accounts", e.accounts, "array", "team::updateSuperTeamMembersMute"), r
			.verifyArrayMax("accounts", e.accounts, 10), this.processCallback(e), e.mute = e.mute ? 1 :
			0, this.sendCmd("updateSuperTeamMembersMute", e)
	}, s.updateSuperTeamMute = function(e) {
		r.verifyOptions(e, "teamId mute", "team::updateSuperTeamMute"), e.mute = e.mute ? 1 : 0, this
			.processCallback(e), this.sendCmd("updateSuperTeamMute", e)
	}, s.updateNickInSuperTeam = function(e) {
		r.verifyOptions(e, "teamId account", "team::updateNickInSuperTeam"), this.processCallback(e),
			this.sendCmd("updateNickInSuperTeam", {
				superTeamMember: new a(e),
				single: !0
			}, e.callback)
	}, s.transferSuperTeam = function(e) {
		r.verifyOptions(e, "teamId account leave", "team::transferSuperTeam"), r.verifyParamType(
			"leave", e.leave, "boolean", "team::transferSuperTeam"), this.processCallback(e);
		var t = {
			teamId: e.teamId,
			account: e.account,
			leave: e.leave
		};
		this.sendCmd("transferSuperTeam", t, e.callback)
	}, s.getSuperTeamMembersByAccounts = function(e) {
		const t = this,
			n = this.db,
			{
				teamId: s,
				accounts: i
			} = e;
		if (r.verifyOptions(e, "teamId accounts", "superTeam::getSuperTeamMembersByAccounts"), r
			.verifyParamType("accounts", i, "array", "superTeam::getSuperTeamMembersByAccounts"), r
			.verifyArrayMax("accounts", i, 20), i.length <= 0) return r.onParamError("参数accounts不能为空数组",
			"superTeam::getSuperTeamMembersByAccounts");

		function o() {
			const n = i.map(e => s + "|" + e);
			t.processCallback(e), t.sendCmd("getSuperTeamMembersByAccounts", {
				memberIds: n
			}, (t, n) => {
				e.done(null, {
					accounts: i,
					members: n.members,
					invaldAccounts: n.invalid
				})
			})
		}
		c.call(this, s).then(({
			valid: t
		}) => t ? function() {
			const t = [],
				r = [],
				o = [];
			i.forEach(e => {
				const i = n.getSuperTeamMemberById(`${s}-${e}`).then(e => {
					r.push(e)
				}).catch(() => {
					o.push(e)
				});
				t.push(i)
			}), Promise.all(t).then(() => {
				e.done(null, {
					accounts: i,
					members: r,
					invaldAccounts: o
				})
			})
		}() : o()).catch(() => o())
	}, s.getMutedSuperTeamMembers = function(e) {
		var t = this,
			{
				joinTime: n,
				reverse: s,
				limit: o,
				teamId: a
			} = e;
		s = !!s, i(n) && (n = 0), i(o) && (o = 100), r.verifyOptions(e, "teamId",
				"superTeam::getSuperTeamMembersByJoinTime"), r.verifyParamType("joinTime", n, "number",
				"api::superTeam::getSuperTeamMembersByJoinTime"), r.verifyParamType("limit", o,
				"number", "api::superTeam::getSuperTeamMembersByJoinTime"), this.processCallback(e), t
			.sendCmd("getMutedSuperTeamMembers", {
				teamId: a,
				limit: o,
				joinTime: n,
				reverse: s
			}, e.callback)
	}
}, function(e, t, n) {
	var s = n(3).fn,
		r = n(0),
		i = r.undef,
		o = r.notundef,
		a = n(47);

	function c(e, t) {
		const n = [],
			s = [],
			r = this.db,
			i = this;
		return r.enable ? (e.forEach(e => {
			const t = this.protocol.findSession(e);
			t ? o(t) : s.push(r.getSession(e).then(e => o(e)))
		}), Promise.all(s).then(() => n)) : (e.forEach(e => o(this.protocol.findSession(e))), Promise
			.resolve(n));

		function o(e) {
			e ? e.lastMsg ? e.scene && e.to ? e.ack >= e.lastMsg.time ? i.logger.warn(
				`${t} not need ack ${e.id}`) : n.push(e) : i.logger.warn(
				`${t} session.scene|to undefined ${e.id}`) : i.logger.warn(
				`${t} session.lastMsg undefined ${e.id}`) : i.logger.warn(
				`${t} session undefined ${e.id}`)
		}
	}
	s.setCurrSession = function(e) {
		this.resetSessionUnread(e), this.protocol.setCurrSession(e)
	}, s.resetAllSessionUnread = function() {
		const e = this;
		for (let t in e.protocol.sessionSet) e.protocol.sessionSet[t].unread > 0 && e
			.resetSessionUnread(t)
	}, s.resetSessionsUnread = function(e, t = (() => {})) {
		const n = this;
		n.logger.info("resetSessionsUnread::", e), c.call(this, e, "api::resetSessionsUnread").then(
		e => {
			if (n.protocol.resetSessionsUnread(e), !n.options.syncSessionUnread || 0 === e
				.length) return void t();
			const s = e.map(e => ({
				scene: "p2p" === e.scene ? 0 : 1,
				to: e.to,
				timetag: e.lastMsg.time
			}));
			n.sendCmd("markSessionAckBatch", {
				sessionAckTags: s
			}, e => {
				t(e || null)
			})
		})
	}, s.resetSuperTeamSessionsUnread = function(e, t = (() => {})) {
		const n = this;
		n.logger.info("resetSuperTeamSessionsUnread::", e), c.call(this, e,
			"api::resetSuperTeamSessionsUnread").then(e => {
			if (n.protocol.resetSessionsUnread(e), !n.options.syncSessionUnread || 0 === e
				.length) return void t();
			const s = e.map(e => ({
				to: e.to,
				timetag: e.lastMsg.time
			}));
			n.sendCmd("markSuperTeamSessionsAck", {
				sessionAckTags: s
			}, e => {
				t(e || null)
			})
		})
	}, s.resetSessionUnread = function(e, t = (() => {})) {
		const n = this,
			s = !1 !== n.options.resetUnreadMode,
			r = (n = null) => {
				n ? t(n, e) : t(null)
			};
		n.logger.info("resetSessionUnread::use reset mode", s);
		const i = n.protocol.findSession(e);
		(!i && this.db.enable ? n.db.getSession(e) : Promise.resolve(i)).then(t => t ? n.options
			.syncSessionUnread ? (s && n.protocol.resetSessionUnread(t), void
				function(t) {
					if (!t.lastMsg) return n.logger.warn(
						"api::resetSessionUnread: session.lastMsg undefined " + e), r();
					if (!t.scene || !t.to) return n.logger.warn(
						"api::resetSessionUnread: session.scene|to undefined " + e), r();
					const i = t.lastMsg.time;
					if (t && t.ack && t.ack >= i) return n.logger.warn(
						"api::resetSessionUnread: session ack not needs " + e), r();
					const o = {};
					if (o.done = e => {
							e ? (n.logger.error({
								message: e || "mark ack failed",
								callFunc: "resetSessionUnread"
							}), r(e || "mark ack failed")) : (s || n.protocol
								.resetSessionUnread(t), r())
						}, n.processCallback(o), "superTeam" === t.scene) n.sendCmd(
						"markSuperTeamSessionAck", {
							to: t.to,
							timetag: i
						}, o.callback);
					else {
						const e = {
							scene: "p2p" === t.scene ? 0 : 1,
							to: t.to,
							timetag: i
						};
						n.sendCmd("markSessionAck", e, o.callback)
					}
				}(t)) : (n.protocol.resetSessionUnread(t), r()) : (n.logger.warn(
				"api::resetSessionUnread: session undefined " + e), r()))
	}, s.resetCurrSession = function() {
		this.protocol.setCurrSession("")
	}, s.insertLocalSession = function(e) {
		var t, n;

		function s() {
			e.session = n, e.done(t, e)
		}
		r.verifyOptions(e, "scene to", "scene::insertLocalSession"), r.verifyParamValid("scene", e
				.scene, this.message.validScenes, "scene::insertLocalSession"), this.protocol
			.insertLocalSession(e).then((function(e) {
				n = e, s()
			}), (function(e) {
				t = e, s()
			}))
	}, s.getLocalSessions = function(e) {
		var t, n = this,
			s = n.db,
			a = [];

		function c() {
			e.sessions = a, delete e.callback, e.done(t, e)
		}
		r.verifyOptions(e), i(e.limit) && (e.limit = 100), r.verifyParamType("limit", e.limit, "number",
				"scene::getLocalSessions"), r.verifyParamMax("limit", e.limit, 100,
				"scene::getLocalSessions"), o(e.reverse) ? r.verifyParamType("reverse", e.reverse,
				"boolean", "scene::getLocalSessions") : e.reverse = !1, n.processCallback(e), s.enable ?
			s.getSessions(e).then((function(e) {
				a = e, n.protocol.mergeSessions(a), c()
			}), (function(e) {
				t = e, c()
			})) : c()
	}, s.getLocalSession = function(e) {
		var t, n = this.db,
			s = null;
		if (r.verifyOptions(e, "sessionId", "scene::getLocalSession"), r.verifyParamType("sessionId", e
				.sessionId, "string", "scene::getLocalSession"), n.enable) return this.processCallback(
			e), void n.getSession(e.sessionId).then((function(e) {
			e && (s = e), i()
		}), (function(e) {
			t = e, i()
		}));

		function i() {
			e.done(t, s)
		}
		s = this.protocol.findSession(e.sessionId), i()
	}, s.getLocalSessionsByMsgType = function(e) {
		var t = this.db,
			n = e.exclude,
			s = [],
			i = a.validTypes.slice(0);
		if (o(n)) {
			if ("string" == typeof n) n = [n];
			else if (!Array.isArray(n)) return void r.onParamInvalidType("exclude", ["string",
				"string array"
			], "", "exclude::getLocalSessionsByMsgType");
			n = n.filter(e => i.indexOf(e) > -1), i = i.filter(e => -1 === n.indexOf(e))
		}
		this.processCallback(e), t.enable ? t.getSessions().then(r => {
			n && 0 !== n.length ? i && 0 !== i.length ? (r.forEach((e, o) => {
				var a, c, m;
				e.lastMsg && n.indexOf(e.lastMsg.type) > -1 && (a = o, c = e.id, m =
					t.getMsgs({
						sessionId: c,
						limit: 1,
						types: i
					}).then(e => (e && e[0] ? r[a].lastMsg = e[0] : r[a]
						.lastMsg = null, Promise.resolve())), s.push(m))
			}), Promise.all(s).then(t => {
				e.done(null, {
					exclude: n,
					sessions: r
				})
			})) : e.done(null, {
				exclude: n,
				sessions: r.map(e => {
					e.lastMsg = null
				})
			}) : e.done(null, {
				exclude: n,
				sessions: r
			})
		}) : e.done(null, {
			exclude: n,
			sessions: []
		})
	}, s.updateLocalSession = function(e) {
		var t, n = this,
			s = n.db;
		r.verifyOptions(e, "id", "scene::updateLocalSession"), n.processCallback(e);
		var i = r.filterObj(e, "id localCustom");

		function o() {
			n.protocol.onUpdateSession(i), e.session = i, e.done(t, e)
		}
		s.enable ? s.updateSession(i).then((function(e) {
			i = e, o()
		}), (function(e) {
			t = e, o()
		})) : o()
	}, s.deleteLocalSession = function(e) {
		var t, n = this,
			s = n.db;
		if (r.verifyOptions(e, "id", "session::deleteLocalSession"), n.processCallback(e), s.enable ? (e
				.isLogic ? s.deleteSessionLogic(e.id) : s.deleteSession(e.id)).then((function() {
				n.protocol.deleteLocalSession(e.id, e.isLogic), o()
			}), (function(e) {
				t = e, o()
			})) : o(), e.isDeleteRoaming) {
			var i = "string" == typeof e.id ? [e.id] : e.id;
			i = i.map(e => e.replace("-", "|")), this.sendCmd("deleteSessions", {
				sessions: i
			}, (function() {}))
		}

		function o() {
			e.done(t, e)
		}
	}, s.deleteSession = function(e, t) {
		t || this.logger.warn("this api will be abandon,please use “deleteRoamingMsgBySession”"), r
			.verifyOptions(e, "scene to", "session::deleteSession"), this.processCallback(e), e
			.sessions = [{
				scene: e.scene,
				to: e.to
			}], this.deleteSessions(e)
	}, s.deleteRoamingMsgBySession = function(e) {
		this.deleteSession(e, !0)
	}, s.deleteSessions = function(e) {
		r.verifyOptions(e, "sessions", "session::deleteSessions"), r.verifyParamType("sessions", e
			.sessions, "array", "session::deleteSessions"), e.sessions.forEach((function(e, t) {
			r.verifyOptions(e, "scene to", !0, "sessions[" + t + "].",
				"session::deleteSessions")
		})), this.processCallback(e), this.sendCmd("deleteSessions", {
			sessions: e.sessions.map((function(e) {
				return e.scene + "|" + e.to
			}))
		}, e.callback)
	}, s.getServerSessions = function(e) {
		o(e.minTimestamp) && r.verifyParamType("minTimestamp", e.minTimestamp, "number",
			"session::deleteSessions"), o(e.maxTimestamp) && r.verifyParamType("maxTimestamp", e
			.maxTimestamp, "number", "session::deleteSessions"), o(e.needLastMsg) && (e
			.needLastMsg = !1 === e.needLastMsg ? 0 : 1), o(e.limit) && (r.verifyParamType("limit",
			e.limit, "number", "session::deleteSessions"), r.verifyParamMax("limit", e.limit,
			100, "scene::getLocalSessions")), this.processCallback(e), this.sendCmd(
			"getServerSessions", {
				sessionReqTag: e
			}, e.callback)
	}, s.getServerSession = function(e) {
		r.verifyOptions(e, "scene to", "scene::getServerSession"), r.verifyParamValid("scene", e.scene,
			this.message.validScenes, "scene::getServerSession"), r.verifyParamType("to", e.to,
			"string", "to::getServerSession");
		var t = e.scene + "|" + e.to;
		"superTeam" === e.scene && (t = "super_team|" + e.to), this.processCallback(e), this.sendCmd(
			"getServerSession", {
				session: {
					id: t
				}
			}, e.callback)
	}, s.updateServerSession = function(e) {
		r.verifyOptions(e, "scene to", "scene::updateServerSession"), r.verifyParamValid("scene", e
			.scene, this.message.validScenes, "scene::updateServerSession"), r.verifyParamType("to",
			e.to, "string", "to::updateServerSession"), o(e.extra) && r.verifyParamType("extra", e
			.extra, "string", "extra::updateServerSession");
		var t = e.scene + "|" + e.to;
		"superTeam" === e.scene && (t = "super_team|" + e.to), this.processCallback(e), this.sendCmd(
			"updateServerSession", {
				session: {
					id: t,
					ext: e.extra || ""
				}
			}, e.callback)
	}, s.deleteServerSessions = function(e) {
		r.verifyOptions(e, "sessions", "scene::deleteServerSessions"), r.verifyParamType("sessions", e
			.sessions, "array", "sessions::deleteServerSessions");
		var t = [];
		e.sessions.forEach(e => {
			r.verifyParamValid("scene", e.scene, this.message.validScenes,
				"scene::deleteServerSessions"), r.verifyParamType("to", e.to, "string",
				"to::deleteServerSessions");
			var n = e.scene + "|" + e.to;
			"superTeam" === e.scene && (n = "super_team|" + e.to), t.push({
				id: n
			})
		}), this.processCallback(e), this.sendCmd("deleteServerSessions", {
			sessions: t
		}, e.callback)
	}, s.updateSessionsWithMoreRoaming = function(e) {
		if (r.verifyOptions(e, "msg", "session::updateSessionsWithMoreRoaming"), r.verifyCallback(e,
				"done", "session::updateSessionsWithMoreRoaming"), !this.db.enable) return e.done(null,
			"db is disable");
		var t = {
			time: e.msg.time,
			idServer: e.msg.idServer,
			to: e.msg.to,
			from: e.msg.from
		};
		r.verifyParamType("msg.time", e.msg.time, "number", "time::updateSessionsWithMoreRoaming"), r
			.verifyParamType("msg.idServer", e.msg.idServer, "string",
				"idServer::updateSessionsWithMoreRoaming"), r.verifyParamType("msg.from", e.msg.from,
				"string", "from::updateSessionsWithMoreRoaming"), r.verifyParamType("msg.to", e.msg.to,
				"string", "to::updateSessionsWithMoreRoaming"), r.verifyParamValid("scene", e.msg.scene,
				this.message.validScenes, "scene::updateSessionsWithMoreRoaming");
		var n = t.to === this.account ? t.from : t.to;
		t.id = `${e.msg.scene}-${n}`, this.db.updateSessionsWithMoreRoaming(t).then(t => {
			e.done(null, t)
		}).catch(t => {
			e.done(t)
		})
	}, s.deleteSessionsWithMoreRoaming = function(e) {
		if (r.verifyOptions(e, "id", "session::deleteSessionsWithMoreRoaming"), r.verifyCallback(e,
				"done", "session::deleteSessionsWithMoreRoaming"), !this.db.enable) return e.done(null,
			"db is disable");
		this.db.deleteSessionsWithMoreRoaming(e.id).then(t => {
			e.done(null, t)
		}).catch(t => {
			e.done(t)
		})
	}, s.getSessionsWithMoreRoaming = function(e) {
		if (r.verifyCallback(e, "done", "session::getSessionsWithMoreRoaming"), !this.db.enable)
		return e.done(null, "db is disable");
		this.db.getSessionsWithMoreRoaming(e.id).then(t => {
			e.done(null, t)
		}).catch(t => {
			e.done(t)
		})
	}
}, function(e, t, n) {
	var s = n(3).fn,
		r = n(0),
		i = r.undef,
		o = r.notundef,
		a = n(5),
		c = n(27),
		m = n(21),
		u = n(4);
	s.sendG2Msg = function(e) {
		return this.processCallback(e), e.msg = new this.message.G2Message(e), this.sendMsg(e)
	}, s.beforeSendMsg = function(e) {
		var t, n = this.protocol,
			s = e.msg;
		switch (s.to === this.account && (s.fromDeviceId = a.deviceId), s.userUpdateTime = n.myInfo && n
			.myInfo.updateTime, s.getScene()) {
			case "p2p":
				t = "sendMsg";
				break;
			case "team":
				t = "sendTeamMsg";
				break;
			case "superTeam":
				t = "sendSuperTeamMsg"
		}
		e.filter && (t = "sendFilterMsg", s.filter = !0), e.cmd = t
	}, s.afterSendMsg = function(e) {
		var t = e.rtnMsg;
		if (!t || !t.ignore) {
			var n = this.protocol.findSession(t.sessionId);
			e.isLocal && n && n.lastMsg && t.time < n.lastMsg.time || this.protocol.onUpdateSession(c
				.genSessionByMsg(t))
		}
	}, s.beforeForwardMsg = function(e) {
		r.verifyOptions(e, "msg scene to", "msg::beforeForwardMsg"), e.msg.scene = e.scene, e.msg.to = e
			.to
	}, s.markMsgRead = function(e) {
		var t = this.protocol;
		!e || this.db.enable || t.options.autoMarkRead ? this.logger.warn(
			"api::markMsgRead: 不需要标记消息为已收到 (没有消息, 或者启用了数据库, 或者启用了自动标记已收到)") : t.markMsgRead(e, !0)
	}, s.sendMsgReceipt = function(e) {
		if (r.verifyOptions(e), this.processCallback(e), e.msg) {
			r.verifyOptions(e, "msg", "msg::sendMsgReceipt");
			var t = e.msg;
			r.verifyOptions(t, "target idClient time", !0, "msg.", "msg::sendMsgReceipt"), this.protocol
				.shouldSendMsgReceipt(t) ? this.sendCmd("sendMsgReceipt", {
					msgReceipt: {
						to: t.target,
						idClient: t.idClient,
						time: t.time
					}
				}, e.callback) : e.done()
		} else e.done()
	}, s.isMsgRemoteRead = function(e) {
		return this.protocol.isMsgRemoteRead(e)
	}, s.recallMsg = function(e) {
		this.deleteMsg(e, !0)
	}, s.deleteMsg = function(e, t) {
		t || this.logger.warn("this api will be abandon,please use “recallMsg”");
		r.verifyOptions(e, "msg", "msg::deleteMsg");
		var n = e.msg;
		if ("team" !== n.scene && n.from !== this.account || "success" !== n.status || n.isLocal)
		return e.done(u.newParamError("只能删除自己发的, 并且发送成功的消息，且不能是本地消息", {
				callFunc: "msg::deleteMsg"
			}), e);
		r.verifyOptions(n, ["scene", "to", "from", "time", "idClient", "idServer"], !0, "msg.",
			"msg::deleteMsg"), r.verifyParamValid("msg.scene", n.scene, this.message.validScenes,
			"msg::deleteMsg"), this.processPs(e), this.processCallback(e);
		var s = {
				deletedIdClient: n.idClient,
				deletedIdServer: n.idServer,
				time: n.time,
				from: n.from,
				to: n.to,
				opeAccount: n.from
			},
			i = "superTeam" === n.scene ? "deleteSuperTeamMsg" : "deleteMsg";
		s.type = "deleteMsg" + n.scene[0].toUpperCase() + n.scene.slice(1);
		["ps", "apnsText", "pushPayload", "env", "opeAccount", "attach"].forEach(t => {
			e[t] && (s[t] = e[t])
		}), s = new m(s), this.sendCmd(i, {
			sysMsg: s,
			msg: n
		}, e.callback)
	}, s.deleteMsgSelf = function(e) {
		r.verifyOptions(e, "msg", "msg::deleteMsgSelf");
		var t = e.msg;
		if ("superTeam" === t.scene) return e.done(u.newParamError("单向删除暂不支持超大群场景", {
			callFunc: "msg::deleteMsgSelf"
		}), e);
		r.verifyOptions(t, ["scene", "to", "from", "time", "idClient", "idServer"], !0, "msg.",
			"msg::deleteMsgSelf"), r.verifyParamValid("msg.scene", t.scene, this.message
			.validScenes, "msg::deleteMsgSelf"), this.processCallback(e);
		var n = {
			scene: "p2p" === t.scene ? 1 : 2,
			from: t.from,
			to: t.to,
			time: t.time,
			idClient: t.idClient,
			idServer: t.idServer,
			custom: e.custom
		};
		this.sendCmd("deleteMsgSelf", {
			deleteMsgSelfTag: n
		}, e.callback)
	}, s.deleteMsgSelfBatch = function(e) {
		if (r.verifyOptions(e, "msgs", "msg::deleteMsgSelfBatch"), (!Array.isArray(e.msgs) || 0 === e
				.msgs.length || e.msgs.length > 100) && r.onParamError("msgs应该是数组且数据长度应大于0小于等于100",
				"msg::deleteMsgSelfBatch"), e.msgs.some(e => "superTeam" === e.scene)) return e.done(u
			.newParamError("消息列表中存在超大群消息，单向删除暂不支持超大群场景", {
				callFunc: "msg::deleteMsgSelfBatch"
			}), e);
		e.msgs.forEach(e => {
			r.verifyOptions(e, ["scene", "to", "from", "time", "idClient", "idServer"], !0,
				"msg.", "msg::deleteMsgSelfBatch"), r.verifyParamValid("msg.scene", e.scene,
				this.message.validScenes, "msg::deleteMsgSelfBatch")
		}), this.processCallback(e);
		var t = e.msgs.map(t => ({
			scene: "p2p" === t.scene ? 1 : 2,
			from: t.from,
			to: t.to,
			time: t.time,
			idClient: t.idClient,
			idServer: t.idServer,
			sessionId: t.sessionId || `${t.scene}-${t.to}`,
			custom: e.custom
		}));
		this.sendCmd("deleteMsgSelfBatch", {
			deleteMsgSelfTags: t
		}, e.callback)
	};
	const l = {
		text: 0,
		image: 1,
		audio: 2,
		video: 3,
		geo: 4,
		notification: 5,
		file: 6,
		tip: 10,
		robot: 11,
		custom: 100
	};
	s.getHistoryMsgs = function(e) {
		r.verifyOptions(e, "scene to", "msg::getHistoryMsgs"), r.verifyParamValid("scene", e.scene, this
			.message.validScenes, "msg::getHistoryMsgs"), void 0 === e.beginTime && (e.beginTime =
			0);
		var t, n = this.protocol.findSession(e.scene + "-" + e.to),
			s = n && n.lastEmptyTime;
		switch (s > e.beginTime && (e.beginTime = s), r.verifyParamType("beginTime", e.beginTime,
				"number", "msg::getHistoryMsgs"), void 0 === e.endTime && (e.endTime = 0), r
			.verifyParamType("endTime", e.endTime, "number", "msg::getHistoryMsgs"), e.lastMsgId = e
			.lastMsgId && +e.lastMsgId ? e.lastMsgId : "0", void 0 === e.limit && (e.limit = 100), r
			.verifyParamType("limit", e.limit, "number", "msg::getHistoryMsgs"), r.verifyParamMax(
				"limit", e.limit, 100, "msg::getHistoryMsgs"), o(e.reverse) ? r.verifyParamType(
				"reverse", e.reverse, "boolean", "msg::getHistoryMsgs") : e.reverse = !1, o(e.asc) ? r
			.verifyParamType("asc", e.asc, "boolean", "msg::getHistoryMsgs") : e.asc = !1, i(e
			.msgTypes) ? e.msgTypes = [] : Array.isArray(e.msgTypes) ? (e.msgTypes = e.msgTypes.map(e =>
				l[e]), e.msgTypes = e.msgTypes.filter(e => "number" == typeof e)) : "number" ==
			typeof l[e.msgTypes] ? e.msgTypes = [l[e.msgTypes]] : e.msgTypes = [], this.processCallback(
				e), e.asc && (e.cbaop = function(e, t) {
				e || (t.msgs = t.msgs.reverse())
			}), e.scene) {
			case "p2p":
				t = "getHistoryMsgs";
				break;
			case "team":
				t = "getTeamHistoryMsgs";
				break;
			case "superTeam":
				t = "getSuperTeamHistoryMsgs"
		}
		var a = {
			scene: e.scene,
			to: e.to,
			beginTime: e.beginTime,
			endTime: e.endTime,
			lastMsgId: e.lastMsgId,
			limit: e.limit,
			reverse: e.reverse,
			msgTypes: e.msgTypes
		};
		this.sendCmd(t, a, e.callback)
	}, s.searchHistoryMsgs = function(e) {
		r.verifyOptions(e, "scene to keyword", "msg::searchHistoryMsgs"), r.verifyParamValid("scene", e
			.scene, this.message.validScenes, "msg::searchHistoryMsgs"), void 0 === e.beginTime && (
			e.beginTime = 0);
		var t, n = this.protocol.findSession(e.scene + "-" + e.to),
			s = n && n.lastEmptyTime;
		switch (s > e.beginTime && (e.beginTime = s), r.verifyParamType("beginTime", e.beginTime,
				"number", "msg::searchHistoryMsgs"), void 0 === e.endTime && (e.endTime = 0), r
			.verifyParamType("endTime", e.endTime, "number", "msg::searchHistoryMsgs"), void 0 === e
			.limit && (e.limit = 100), r.verifyParamType("limit", e.limit, "number",
				"msg::searchHistoryMsgs"), r.verifyParamMax("limit", e.limit, 100,
				"msg::searchHistoryMsgs"), o(e.reverse) ? r.verifyParamType("reverse", e.reverse,
				"boolean", "msg::searchHistoryMsgs") : e.reverse = !1, o(e.asc) ? r.verifyParamType(
				"asc", e.asc, "boolean", "msg::searchHistoryMsgs") : e.asc = !1, this.processCallback(
			e), e.asc && (e.cbaop = function(e, t) {
				e || (t.msgs = t.msgs.reverse())
			}), e.scene) {
			case "p2p":
				t = "searchHistoryMsgs";
				break;
			case "team":
				t = "searchTeamHistoryMsgs"
		}
		var i = r.filterObj(e, "scene to beginTime endTime keyword limit reverse");
		this.sendCmd(t, i, e.callback)
	}, s.getLocalMsgs = function(e) {
		var t = this,
			n = t.db,
			s = [];
		r.verifyOptions(e);
		let a = !1;
		o(e.start) && (a = !0, r.verifyParamType("start", e.start, "number", "msg::getLocalMsgs"));
		let c = !1;
		if (o(e.end) && (c = !0, r.verifyParamType("end", e.end, "number", "msg::getLocalMsgs")), a &&
			c && e.end <= e.start && r.onParamError("参数 end 必须晚于 start"), o(e.subTypes) && r
			.verifyParamType("subTypes", e.subTypes, "array", "msg::getLocalMsgs"), i(e.limit) && (e
				.limit = 100), r.verifyParamType("limit", e.limit, "number", "msg::getLocalMsgs"), r
			.verifyParamMin("limit", e.limit, 1, "msg::getLocalMsgs"), t.processCallback(e), n.enable) {
			var m = (new Date).getTime();
			n.getMsgs(e).then(n => {
				s = n, t.logger.info(
					`api::getLocalMsgs: query db cost ${(new Date).getTime()-m} ms and the conditions is ${JSON.stringify(e)}`
					), u()
			}, e => {
				(e = e || {}).message = e.message || "msg::getLocalMsgs:db error", u()
			})
		} else u();

		function u() {
			var t = r.simpleClone(e);
			t.msgs = s, delete t.callback, delete t.done, e.done(null, t)
		}
	}, s.getLocalMsgsInUnread = function(e) {
		var t = this;
		r.validate({
			sessionId: {
				type: "string",
				allowEmpty: !1
			}
		}, e), this.getLocalSession({
			sessionId: e.sessionId,
			done(n, s) {
				n ? e.done && e.done(n) : s ? (s.ack = s.ack || 0, t.getLocalMsgs({
					sessionId: e.sessionId,
					start: s.ack,
					limit: Number.MAX_SAFE_INTEGER,
					filterFunc: e => "in" === e.flow && !0 === e.isUnreadable,
					done: function() {},
					...e
				})) : e.done && e.done(new Error(`session ${e.sessionId} not exist`))
			}
		})
	}, s.getLocalMsgByIdClient = function(e) {
		var t = this.db,
			n = null,
			s = null;

		function i() {
			e.msg = s, e.done(n, e)
		}
		r.verifyOptions(e, "idClient", "msg::getLocalMsgByIdClient"), this.processCallback(e), t
			.enable ? t.getMsgByIdClient(e.idClient).then((function(e) {
				e && (s = e), i()
			}), (function(e) {
				n = e, i()
			})) : (this.logger.warn("because db is false,error is null"), i())
	}, s.getLocalMsgsByIdClients = function(e) {
		var t, n = this.db,
			s = [];

		function i() {
			e.msgs = s, e.done(t, e)
		}
		r.verifyOptions(e, "idClients", "msg::getLocalMsgByIdClients"), r.verifyParamType("idClients", e
				.idClients, "array", "msg::getLocalMsgByIdClients"), this.processCallback(e), n.enable ?
			n.getMsgsByIdClients(e.idClients).then((function(e) {
				s = e.filter((function(e) {
					return !!e
				})), i()
			}), (function(e) {
				t = e, i()
			})) : i()
	}, s.updateLocalMsg = function(e) {
		var t, n = this.db,
			s = null;
		if (r.verifyOptions(e, "idClient", "msg::updateLocalMsg"), this.processCallback(e), n.enable) {
			var i = r.filterObj(e, "idClient localCustom");
			n.updateMsg(i).then((function(e) {
				s = e, o()
			}), (function(e) {
				t = e, o()
			}))
		} else o();

		function o() {
			e.msg = s, e.done(t, e)
		}
	}, s.deleteLocalMsg = function(e) {
		var t;
		r.verifyOptions(e, "msg", "msg::deleteLocalMsg");
		var n = e.msg;

		function s() {
			e.done(t, e)
		}
		r.verifyOptions(n, "idClient sessionId", !0, "msg.", "msg::deleteLocalMsg"), this
			.processCallback(e), this.protocol.deleteLocalMsg(n).then(s, (function(e) {
				t = e, s()
			}))
	}, s.deleteLocalMsgsBySession = function(e) {
		var t, n = this,
			s = n.db;
		r.verifyOptions(e, "scene to", "msg::deleteLocalMsgsBySession"), r.verifyParamValid("scene", e
				.scene, n.message.validScenes, "msg::deleteLocalMsgsBySession"), e.sessionId = e.scene +
			"-" + e.to, e.delLastMsg = !0 === e.delLastMsg, e.isTag = !0 === e.isTag;
		var i = (new Date).getTime();

		function o() {
			e.done(t, e)
		}
		n.processCallback(e);
		var a = {
			id: e.sessionId
		};
		e.delLastMsg && (a.lastMsg = null), e.isTag && (a.lastEmptyTime = i), s.enable ? s
			.deleteMsgsBySessionId(e).then(() => {
				e.delLastMsg || e.isTag ? s.updateSession(a).then(t => {
					n.protocol.onUpdateSession(t), e.session = t, o()
				}) : o()
			}).catch((function(e) {
				t = e, o()
			})) : (this.logger.warn("because db is false,error is null"), o(), (e.delLastMsg || e
				.isTag) && n.protocol.onUpdateSession(a))
	}, s.deleteLocalMsgs = function(e) {
		var t, n = this,
			s = n.db,
			i = !1 !== e.updateSession;

		function a() {
			e.done(t, e)
		}
		r.verifyOptions(e, "sessionId", "msg::deleteLocalMsgsBySession"), o(e.start) && r
			.verifyParamType("start", e.start, "number", "msg::deleteLocalMsgs"), o(e.end) && r
			.verifyParamType("end", e.end, "number", "msg::deleteLocalMsgs"), o(e.end) && o(e.start) &&
			e.end <= e.start && r.onParamError("参数 end 必须大于 start"), n.processCallback(e), s.enable ? s
			.deleteMsgsBySessionId(e).then(() => {
				a(), i && n.protocol.checkAndUpdateLocalSessionByMsg(e.sessionId)
			}, e => {
				t = e, a()
			}) : (this.logger.warn("because db is false,error is null"), a())
	}, s.deleteAllLocalMsgs = function(e) {
		var t, n = this.db;

		function s() {
			e.done(t, e)
		}
		this.processCallback(e), this.protocol.sessionSet = {}, n.enable ? n.deleteAllMsgs().then((
			function() {
				s()
			}), (function(e) {
			t = e, s()
		})) : (this.logger.warn("because db is false,error is null"), s())
	}, s.saveMsgsToLocal = function(e) {
		this.db.enable || (this.logger.warn("because db is false,error is null"), e.done(null, [])), r
			.verifyOptions(e, "msgs done", "msg::saveMsgsToLocal"), r.verifyParamType("msgs", e.msgs,
				"Array", "msg::saveMsgsToLocal"), this.db.putMsg(e.msgs).then((t, n) => {
				n ? e.done(n) : e.done(null, t)
			})
	}, s.clearServerHistoryMsgs = function(e) {
		r.verifyOptions(e, "account", "msg::clearServerHistoryMsgs");
		var t = !1 !== e.delRoam;
		this.processCallback(e), this.sendCmd("clearServerHistoryMsgs", {
			clearMsgsParams: {
				account: e.account,
				delRoam: t ? 1 : 0
			}
		}, e.callback)
	}, s.clearServerHistoryMsgsWithSync = function(e) {
		r.verifyOptions(e, "scene to", "msg::clearServerHistoryMsgsWithSync");
		var t = {
			type: "team" === e.scene ? 2 : 1,
			isDeleteRoam: 1,
			isSyncSelf: !0 === e.isSyncSelf ? 1 : 0
		};
		t[2 === t.type ? "toTid" : "otherAccid"] = e.to, void 0 !== e.ext && (t.ext = e.ext), this
			.processCallback(e), this.sendCmd("clearServerHistoryMsgsWithSync", {
				clearMsgsParamsWithSync: t
			}, e.callback)
	}, s.msgFtsInServer = function(e) {
		this.processCallback(e);
		const {
			callback: t,
			done: n,
			...s
		} = e;
		r.validate({
				keyword: {
					type: "string"
				},
				fromTime: {
					type: "number",
					required: !1
				},
				toTime: {
					type: "number",
					required: !1
				},
				sessionLimit: {
					type: "number",
					min: 0,
					required: !1
				},
				msgLimit: {
					type: "number",
					min: 0,
					required: !1
				},
				order: {
					type: "enum",
					values: ["ASC", "DESC"],
					required: !1
				},
				p2pList: {
					type: "array",
					required: !1
				},
				teamList: {
					type: "array",
					required: !1
				},
				senderList: {
					type: "array",
					required: !1
				},
				msgTypeList: {
					type: "array",
					required: !1
				},
				msgSubTypeList: {
					type: "array",
					required: !1
				}
			}, s, "msg::msgFtsInServer"), o(s.toTime) && o(s.fromTime) && s.toTime < s.fromTime && r
			.onParamError("Options error: toTime should be greater than fromTime");
		const i = {
			ASC: 1,
			DESC: 2
		};
		s.order && i[s.order] && (s.order = i[s.order]), s.msgTypeList && (s.msgTypeList = s.msgTypeList
			.map(e => l[e]));
		["p2pList", "teamList", "senderList", "msgTypeList", "msgSubTypeList"].forEach(e => {
			Array.isArray(s[e]) && (s[e] = s[e].join(","))
		}), this.sendCmd("msgFtsInServer", {
			msgFullSearchRequestTag: s
		}, e.callback)
	}, s.msgFtsInServerByTiming = function(e) {
		this.processCallback(e);
		const {
			callback: t,
			done: n,
			...s
		} = e;
		r.validate({
				keyword: {
					type: "string"
				},
				fromTime: {
					type: "number",
					required: !1
				},
				toTime: {
					type: "number",
					required: !1
				},
				msgLimit: {
					type: "number",
					min: 0,
					required: !1
				},
				order: {
					type: "enum",
					values: ["ASC", "DESC"],
					required: !1
				},
				p2pList: {
					type: "array",
					required: !1
				},
				teamList: {
					type: "array",
					required: !1
				},
				senderList: {
					type: "array",
					required: !1
				},
				msgTypeList: {
					type: "array",
					required: !1
				},
				msgSubTypeList: {
					type: "array",
					required: !1
				}
			}, s, "msg::msgFtsInServerByTimeSort"), o(s.toTime) && o(s.fromTime) && s.toTime < s
			.fromTime && r.onParamError("Options error: toTime should be greater than fromTime");
		const i = {
			ASC: 1,
			DESC: 2
		};
		void 0 === s.msgLimit && (s.msgLimit = 20), s.order && i[s.order] && (s.order = i[s.order]), s
			.msgTypeList && (s.msgTypeList = s.msgTypeList.map(e => l[e]));
		["p2pList", "teamList", "senderList", "msgTypeList", "msgSubTypeList"].forEach(e => {
			Array.isArray(s[e]) && (s[e] = s[e].join(","))
		}), this.sendCmd("msgFtsInServerByTiming", {
			msgTimingFullSearchRequestTag: s
		}, e.callback)
	}
}, function(e, t, n) {
	var s = n(3).fn,
		r = n(0),
		i = n(94),
		o = n(95),
		a = r.notundef;

	function c(e, t, n, s) {
		n = n || "", r.verifyParamType(n + "from", e.from, "string", t), r.verifyParamType(n + "to", e.to,
			"string", t), r.verifyParamType(n + "idServer", e.idServer, "string", t), r.verifyParamType(
			n + "time", e.time, "number", t), r.verifyParamValid(n + "scene", e.scene, this.message
			.validScenes, t), s || r.verifyParamType(n + "idClient", e.idClient, "string", t)
	}
	s.getThreadMsgs = function(e) {
		r.verifyCallback(e, "done", "msg::getThreadMsgs"), r.verifyOptions(e,
				"scene threadMsgFromAccount threadMsgToAccount threadMsgIdServer threadMsgTime",
				"msg::getThreadMsgs"), r.verifyParamType("threadMsgFromAccount", e.threadMsgFromAccount,
				"string", "msg::getThreadMsgs"), r.verifyParamType("threadMsgToAccount", e
				.threadMsgToAccount, "string", "msg::getThreadMsgs"), r.verifyParamType(
				"threadMsgIdServer", e.threadMsgIdServer, "string", "msg::getThreadMsgs"), r
			.verifyParamType("threadMsgTime", e.threadMsgTime, "number", "msg::getThreadMsgs"), r
			.verifyParamValid("scene", e.scene, this.message.validScenes, "msg::getThreadMsgs"), this
			.processCallback(e);
		var t = {
				scene: this.message.sceneMap[e.scene],
				from: e.threadMsgFromAccount,
				to: e.threadMsgToAccount,
				time: e.threadMsgTime,
				idServer: e.threadMsgIdServer
			},
			n = {
				limit: e.limit < 100 ? e.limit : 100,
				beginTime: "number" == typeof e.beginTime ? e.beginTime : 0,
				reverse: !0 === e.reverse ? 1 : 0
			};
		e.endTime && e.endTime <= n.beginTime && r.onParamError("endTime应该大于beginTime",
			"msg::getThreadMsgs"), e.lastMsgId && (n.lastMsgId = e.lastMsgId), this.sendCmd(
			"getThreadMsgs", {
				msg: t,
				threadMsgReq: n,
				NOTSTORE: "msg threadMsgReq"
			}, e.callback)
	}, s.getMsgsByIdServer = function(e) {
		let t = this,
			n = "msg::getMsgsByIdServer";
		r.verifyCallback(e, "done", n), (!Array.isArray(e.reqMsgs) || 0 === e.reqMsgs.length || e
				.reqMsgs.length > 100) && r.onParamError("reqMsgs应该是数组且数据长度应大于0小于等于100", n), e.reqMsgs =
			e.reqMsgs.slice(0), e.reqMsgs.forEach((e, s) => {
				c.call(t, e, n, `reqMsgs[${s}].`, !0), e.scene = this.message.sceneMap[e.scene]
			}), this.processCallback(e), this.sendCmd("getMsgsByIdServer", {
				reqMsgs: e.reqMsgs
			}, e.callback)
	}, s.addQuickComment = function(e) {
		r.verifyOptions(e, "msg body", "msg::addQuickComment"), c.call(this, e.msg,
			"msg::addQuickComment");
		var t = new i(e, "msg::addQuickComment");
		t.from = this.account;
		var n = {
			scene: this.message.sceneMap[e.msg.scene],
			from: e.msg.from,
			to: e.msg.to,
			time: e.msg.time,
			idServer: e.msg.idServer,
			idClient: e.msg.idClient
		};
		this.processCallback(e), this.sendCmd("addQuickComment", {
			msg: n,
			comment: t
		}, e.callback)
	}, s.deleteQuickComment = function(e) {
		r.verifyOptions(e, "msg body", "msg::deleteQuickComment"), c.call(this, e.msg,
			"msg::deleteQuickComment");
		var t = new i(e, "msg::addQuickComment");
		t.from = this.account;
		var n = {
			scene: this.message.sceneMap[e.msg.scene],
			from: e.msg.from,
			to: e.msg.to,
			time: e.msg.time,
			idServer: e.msg.idServer,
			idClient: e.msg.idClient
		};
		this.processCallback(e), this.sendCmd("deleteQuickComment", {
			msg: n,
			comment: t
		}, e.callback)
	}, s.getQuickComments = function(e) {
		let t = "msg::getQuickComments",
			n = this,
			s = {},
			i = {};
		r.verifyOptions(e, "msgs", "msg::getQuickComments"), (!Array.isArray(e.msgs) || 0 === e.msgs
			.length || e.msgs.length > 20) && r.onParamError("msgs应该是数组且数据长度应大于0小于等于20", t);
		let o = [];
		try {
			o = JSON.parse(JSON.stringify(e.msgs))
		} catch (e) {
			r.onParamError("msgs 不是合法的对象", t)
		}
		o.forEach((e, r) => {
			c.call(n, e, t, `msgs[${r}].`, !0), e.scene = this.message.sceneMap[e.scene], s[e
				.idClient] = null, i[e.idClient] = r
		}), this.processCallback(e), this.getLocalMsgsByIdClients({
			idClients: Object.keys(s),
			done: (t, r) => {
				var a = n.protocol.timetags.sync;
				!t && r.msgs && r.msgs.length && a && (r.msgs.forEach(e => {
					s[e.idClient] = e
				}), o = o.filter(e => {
					let t = s[e.idClient];
					return !t || (t.commentTimetag && (e.timestamp = t
						.commentTimetag), !(t.commentTimetag > a))
				})), n.sendCmd("getQuickComments", {
					commentReq: o,
					idMap: s,
					indexMap: i
				}, e.callback)
			}
		})
	}, s.addCollect = function(e) {
		r.verifyOptions(e, "type data", "msg::addCollect");
		var t = new o(e, "msg::addCollect");
		this.processCallback(e), this.sendCmd("addCollect", {
			collect: t
		}, e.callback)
	}, s.deleteCollects = function(e) {
		r.verifyOptions(e, "collectList", "msg::deleteCollects"), (!Array.isArray(e.collectList) ||
			0 === e.collectList.length || e.collectList.length > 100) && r.onParamError(
			"collectList应该是数组且数据长度应大于0小于等于100", "msg::deleteCollects"), e.collectList.forEach((e,
			t) => {
				r.verifyParamType(`collectList[${t}].id`, e.id, "string", "msg::deleteCollects"), r
					.verifyParamType(`collectList[${t}].createTime`, e.createTime, "number",
						"msg::deleteCollects")
			}), this.processCallback(e), this.sendCmd("deleteCollects", {
			collectList: e.collectList
		}, e.callback)
	}, s.updateCollect = function(e) {
		r.verifyOptions(e, "collect", "msg::updateCollect"), r.verifyParamType("collect.id", e.collect
			.id, "string", "msg::updateCollect"), r.verifyParamType("collect.createTime", e.collect
			.createTime, "number", "msg::updateCollect"), this.processCallback(e), this.sendCmd(
			"updateCollect", {
				collect: e.collect
			}, e.callback)
	}, s.getCollects = function(e) {
		r.verifyCallback(e, "done", "msg::getCollects");
		var t = {};
		["type", "beginTime", "endTime", "limit"].forEach(n => {
				a(e[n]) && (r.verifyParamType(n, e[n], "number", "msg::getCollects"), t[n] = e[n])
			}), e.limit > 100 && r.onParamError("limit不能大于100", "msg::getCollects"), e.beginTime > e
			.endTime && r.onParamError("beginTime不能大于endTime", "msg::getCollects"), a(e.lastId) && (r
				.verifyParamType("lastId", e.lastId, "string", "msg::getCollects"), t.lastId = e.lastId
				), a(e.reverse) && (t.reverse = !0 === e.reverse), this.processCallback(e), this
			.sendCmd("getCollects", {
				collectQuery: t,
				NOTSTORE: "collectQuery"
			}, e.callback)
	}, s.addStickTopSession = function(e) {
		r.verifyOptions(e, "id", "msg::addStickTopSession");
		let t = r.getIdArray(e.id);
		r.verifyParamValid("id的前半部分", t[0], this.message.validScenes, "msg::addStickTopSession"), r
			.verifyParamType("id的后半部分", t[1], "string", "msg::addStickTopSession"), "superTeam" === t[
			0] && (t[0] = "super_team"), t = t.join("|");
		var n = {
			id: t
		};
		e.topCustom && (r.verifyParamType("topCustom", e.topCustom, "string",
				"msg::addStickTopSession"), n.topCustom = e.topCustom), this.processCallback(e), this
			.sendCmd("addStickTopSession", {
				stickTopSession: n
			}, e.callback)
	}, s.deleteStickTopSession = function(e) {
		r.verifyOptions(e, "id", "msg::deleteStickTopSession");
		let t = r.getIdArray(e.id);
		r.verifyParamValid("id的前半部分", t[0], this.message.validScenes, "msg::deleteStickTopSession"), r
			.verifyParamType("id的后半部分", t[1], "string", "msg::deleteStickTopSession"), "superTeam" ===
			t[0] && (t[0] = "super_team"), t = t.join("|"), this.processCallback(e), this.sendCmd(
				"deleteStickTopSession", {
					stickTopSession: {
						id: t
					}
				}, e.callback)
	}, s.updateStickTopSession = function(e) {
		r.verifyOptions(e, "id", "msg::updateStickTopSession");
		let t = r.getIdArray(e.id);
		r.verifyParamValid("id的前半部分", t[0], this.message.validScenes, "msg::updateStickTopSession"), r
			.verifyParamType("id的后半部分", t[1], "string", "msg::updateStickTopSession"), "superTeam" ===
			t[0] && (t[0] = "super_team"), t = t.join("|");
		var n = {
			id: t
		};
		e.topCustom && (r.verifyParamType("topCustom", e.topCustom, "string",
				"msg::updateStickTopSession"), n.topCustom = e.topCustom), this.processCallback(e), this
			.sendCmd("updateStickTopSession", {
				stickTopSession: n
			}, e.callback)
	}, s.getStickTopSessions = function(e) {
		r.verifyOptions(e, "done", "msg::getStickTopSessions"), this.processCallback(e);
		let t, n = this.protocol.sessionSet,
			s = [];
		for (let r in n) t = this.protocol.findSession(r, e.findDelete), t && t.isTop && s.push(n[r]);
		e.callback(null, s)
	}, s.addMsgPin = function(e) {
		r.verifyOptions(e, "msg", "msg::addMsgPin"), c.call(this, e.msg, "msg::addMsgPin");
		var t = {
			pinFrom: this.account
		};
		a(e.pinCustom) && (r.verifyParamType("pinCustom", e.pinCustom, "string", "msg::addMsgPin"), t
			.pinCustom = e.pinCustom);
		var n = {
			scene: this.message.sceneMap[e.msg.scene],
			from: e.msg.from,
			to: e.msg.to,
			time: e.msg.time,
			idServer: e.msg.idServer,
			idClient: e.msg.idClient
		};
		this.processCallback(e), this.sendCmd("addMsgPin", {
			msg: n,
			pinTag: t
		}, e.callback)
	}, s.updateMsgPin = function(e) {
		r.verifyOptions(e, "msg", "msg::updateMsgPin"), c.call(this, e.msg, "msg::updateMsgPin");
		var t = {
			pinFrom: this.account
		};
		a(e.pinCustom) && (r.verifyParamType("pinCustom", e.pinCustom, "string", "msg::updateMsgPin"), t
			.pinCustom = e.pinCustom);
		var n = {
			scene: this.message.sceneMap[e.msg.scene],
			from: e.msg.from,
			to: e.msg.to,
			time: e.msg.time,
			idServer: e.msg.idServer,
			idClient: e.msg.idClient
		};
		this.processCallback(e), this.sendCmd("updateMsgPin", {
			msg: n,
			pinTag: t
		}, e.callback)
	}, s.deleteMsgPin = function(e) {
		r.verifyOptions(e, "msg", "msg::deleteMsgPin"), c.call(this, e.msg, "msg::deleteMsgPin");
		var t = {
				pinFrom: this.account
			},
			n = {
				scene: this.message.sceneMap[e.msg.scene],
				from: e.msg.from,
				to: e.msg.to,
				time: e.msg.time,
				idServer: e.msg.idServer,
				idClient: e.msg.idClient
			};
		this.processCallback(e), this.sendCmd("deleteMsgPin", {
			msg: n,
			pinTag: t
		}, e.callback)
	}, s.getMsgPins = function(e) {
		r.verifyOptions(e, "id", "msg::getMsgPins");
		let t = this.db,
			n = r.getIdArray(e.id);
		r.verifyParamValid("id的前半部分", n[0], this.message.validScenes, "msg::getMsgPins"), r
			.verifyParamType("id的后半部分", n[1], "string", "msg::getMsgPins"), "superTeam" === n[0] && (n[
				0] = "super_team"), n = n.join("|");
		var s = {
			sessionId: n,
			timetag: 0
		};
		if (this.processCallback(e), t.enable) {
			let n = this.protocol.timetags.sync;
			t.getTimetag("pin-" + e.id).then(r => {
				r > n ? t.getMsgPins(e.id).then(t => e.callback(null, {
					pins: t || []
				})).catch(t => e.callback(t)) : (s.timetag = r, i.call(this))
			})
		} else i.call(this);

		function i() {
			this.sendCmd("getMsgPins", {
				msgPinReq: s,
				id: e.id,
				NOTSTORE: "msgPinReq"
			}, e.callback)
		}
	}
}, function(e, t, n) {
	var s = n(3).fn,
		r = n(0),
		i = r.undef,
		o = r.notundef,
		a = n(21);
	s.markSysMsgRead = function(e) {
		var t, n = this.db,
			s = Promise.resolve(),
			i = this.protocol;
		r.verifyOptions(e, "sysMsgs", "sysmsg::markSysMsgRead");
		var o = e.sysMsgs;

		function a() {
			e.done(t, e)
		}
		r.isArray(o) || (o = [o]), n.enable ? s = n.markSysMsgRead(o).then((function(e) {
			o = e, i.onUpdateSysMsg(e)
		})) : (o = o.filter((function(e) {
			return !e.read
		}))).length && (i.options.autoMarkRead || i.markSysMsgRead(o, !0), o.forEach((function(e) {
			e.read = !0
		})), i.onUpdateSysMsg(o)), s.then((function() {
			return i.reduceSysMsgUnread(o)
		})).then(a, (function(e) {
			t = e, a()
		}))
	}, s.sendCustomSysMsg = function(e) {
		r.verifyOptions(e, "scene to content", "sysmsg::sendCustomSysMsg"), r.verifyParamValid("scene",
			e.scene, this.message.validScenes, "sysmsg::sendCustomSysMsg"), this.processCallback(e);
		var t = "sendCustomSysMsg";
		return "p2p" === e.scene ? e.type = "customP2p" : "superTeam" === e.scene ? (e.type =
				"customSuperTeam", t = "sendSuperTeamCustomSysMsg") : e.type = "customTeam", e.sysMsg =
			new a(e), e.filter && (t = "sendFilterCustomSysMsg"), this.sendCmd(t, {
				sysMsg: e.sysMsg,
				single: !0
			}, e.callback), this.formatReturnSysMsg(e.sysMsg)
	}, s.formatReturnSysMsg = function(e) {
		return e = r.copy(e), this.protocol.completeSysMsg(e), e.status = "sending", e = a.reverse(e)
	}, s.getLocalSysMsgs = function(e) {
		var t, n = this.db,
			s = [];

		function c() {
			e.sysMsgs = s, e.done(t, e)
		}
		r.verifyOptions(e), e.category && r.verifyParamValid("category", e.category, a.validCategories,
				"sysmsg::getLocalSysMsgs"), e.type && r.verifyParamValid("type", e.type, a.validTypes,
				"sysmsg::getLocalSysMsgs"), i(e.limit) && (e.limit = 100), r.verifyParamType("limit", e
				.limit, "number", "sysmsg::getLocalSysMsgs"), r.verifyParamMax("limit", e.limit, 100,
				"sysmsg::getLocalSysMsgs"), o(e.reverse) ? r.verifyParamType("reverse", e.reverse,
				"boolean", "sysmsg::getLocalSysMsgs") : e.reverse = !1, this.processCallback(e), n
			.enable ? n.getSysMsgs(e).then((function(e) {
				s = e, c()
			}), (function(e) {
				t = e, c()
			})) : c()
	}, s.updateLocalSysMsg = function(e) {
		var t, n = this.db,
			s = null;
		if (r.verifyOptions(e, "idServer", "sysmsg::updateLocalSysMsg"), this.processCallback(e), n
			.enable) {
			var i = r.filterObj(e, "idServer state localCustom");
			n.updateSysMsg(i).then((function(e) {
				s = e, o()
			}), (function(e) {
				t = e, o()
			}))
		} else o();

		function o() {
			e.sysMsg = s, e.done(t, e)
		}
	}, s.deleteLocalSysMsg = function(e) {
		var t, n = this.db;

		function s() {
			e.done(t, e)
		}
		r.verifyOptions(e, "idServer", "sysmsg::deleteLocalSysMsg"), this.processCallback(e), n.enable ?
			n.deleteSysMsg(e.idServer).then((function() {
				s()
			}), (function(e) {
				t = e, s()
			})) : s()
	}, s.deleteAllLocalSysMsgs = function(e) {
		var t, n = this,
			s = n.db;

		function r() {
			n.protocol.onUpdateSysMsgUnread({}), e.done(t, e)
		}
		n.processCallback(e), s.enable && s.deleteAllSysMsgs().then((function() {
			r()
		}), (function(e) {
			t = e, r()
		}))
	}
}, function(e, t, n) {
	var s = n(3).fn,
		r = n(0),
		i = n(1);
	s.getChatroomAddress = function(e) {
		r.verifyOptions(e, "chatroomId", "chatroom::getChatroomAddress");
		e.isWeixinApp = i.isWeixinApp, e.type = i.ipVersion, this.processCallback(e), this.sendCmd(
			"getChatroomAddress", e)
	}
}, function(e, t) {}, function(e, t) {}, function(e, t, n) {
	var s = n(3).fn,
		r = n(0);
	s.audioToText = function(e) {
		r.verifyOptions(e, "url", "audio::audioToText"), e.audioToText = r.filterObj(e, "url");
		this.processCallback(e), this.sendCmd("audioToText", e)
	}
}, function(e, t, n) {
	var s = n(3).fn;
	s.clearDB = function(e) {
		var t = this.db;
		this.processCallback(e);
		var n = e.done;
		t.enable ? t.clear().then(n, n) : n()
	}, s.removeDB = function(e) {
		var t = this.db;
		this.processCallback(e);
		var n = e.done;
		t.enable ? t.destroy().then(n, n) : n()
	}, s.closeDB = function(e) {
		var t = this.db;
		this.processCallback(e);
		var n = e.done;
		t.enable ? t.close().then(n, n) : n()
	}
}, function(e, t, n) {
	var s = n(3).fn,
		r = n(51),
		i = n(0),
		o = i.undef;
	s.getPushNotificationMultiportConfig = function() {
		return this.protocol.getPushNotificationMultiportConfig()
	}, s.updatePushNotificationMultiportConfig = function(e) {
		i.verifyOptions(e), o(e.shouldPushNotificationWhenPCOnline) && (e
				.shouldPushNotificationWhenPCOnline = !0), e.donnop = new r(e), this.processCallback(e),
			this.sendCmd("updateDonnop", e)
	}
}, function(e, t, n) {
	const s = n(3).fn,
		r = n(0),
		i = n(173),
		o = n(174);

	function a(e) {
		return "object" == typeof e && (e.msgEventSubscribes ? e = e.msgEventSubscribes : e
			.msgEventSubscribe ? e = e.msgEventSubscribe : e.accounts ? e = e.accounts : e.msgEvent && (
				e = e.msgEvent).time && (e.time = +e.time), 1 === e.sync ? e.sync = !0 : 0 === e.sync &&
			(e.sync = !1)), e
	}
	s.batchSendEventsCmds = function(e, t, n) {
		var s = this;
		let i = r.dropArrayDuplicates(t.accounts);
		i = r.reshape2d(i, 100);
		let o = [];
		i.forEach(n => {
			o.push(new Promise((function(i, o) {
				let c = r.simpleClone(t);
				c.accounts = n, s.sendCmdWithResp(e, c, (function(e, t) {
					e ? o(e) : i(a(t))
				}))
			})))
		}), Promise.all(o).then((function(e) {
			let t = null;
			if (e.length > 0)
				if (e[0].msgEventSubscribe) {
					let n = e[0].msgEventSubscribe;
					n = a(n);
					let s = [];
					e.forEach(e => {
						s = s.concat(e.accounts)
					}), t = {
						accounts: s,
						msgEventSubscribe: n
					}
				} else t = [], e.forEach(e => {
					t = t.concat(e)
				});
			n(null, t)
		}), (function(e) {
			n(e, null)
		}))
	}, s.publishEvent = function(e) {
		var t = new i(e);
		t = t.assembleEvent(), this.processCallback(e), this.sendCmdWithResp("publishEvent", {
			msgEvent: t
		}, (function(t, n) {
			t || (n = a(n)), e.callback(t, n)
		}))
	}, s.subscribeEvent = function(e) {
		r.verifyOptions(e, "accounts", "event::subscribeEvent");
		var t = new o(e);
		r.verifyParamType("accounts", e.accounts, "array", "event::subscribeEvent"), this
			.processCallback(e), t = t.assembleEvent(), this.batchSendEventsCmds("subscribeEvent", {
				msgEventSubscribe: t,
				accounts: e.accounts
			}, (function(t, n) {
				!t && n && (n = {
					failedAccounts: n
				}), e.callback(t, n)
			}))
	}, s.unSubscribeEventsByAccounts = function(e) {
		r.verifyOptions(e, "accounts", "event::unSubscribeEventsByAccounts"), r.verifyParamType(
			"accounts", e.accounts, "array", "event::unSubscribeEventsByAccounts");
		var t = new o(e);
		t = t.assembleEvent(), this.processCallback(e), this.batchSendEventsCmds(
			"unSubscribeEventsByAccounts", {
				msgEventSubscribe: t,
				accounts: e.accounts
			}, (function(t, n) {
				!t && n && (n = {
					failedAccounts: n
				}), e.callback(t, n)
			}))
	}, s.unSubscribeEventsByType = function(e) {
		var t = new o(e);
		t = t.assembleEvent(), this.processCallback(e), this.sendCmdWithResp(
		"unSubscribeEventsByType", {
			msgEventSubscribe: t
		}, (function(t, n) {
			e.callback(t)
		}))
	}, s.querySubscribeEventsByAccounts = function(e) {
		r.verifyOptions(e, "accounts", "event::querySubscribeEventsByAccounts"), r.verifyParamType(
			"accounts", e.accounts, "array", "event::querySubscribeEventsByAccounts");
		var t = new o(e);
		t = t.assembleEvent(), this.processCallback(e), this.batchSendEventsCmds(
			"querySubscribeEventsByAccounts", {
				msgEventSubscribe: t,
				accounts: e.accounts
			}, (function(t, n) {
				!t && n && (n = {
					msgEventSubscribes: n
				}), e.callback(t, n)
			}))
	}, s.querySubscribeEventsByType = function(e) {
		var t = new o(e);
		t = t.assembleEvent(), this.processCallback(e), this.sendCmdWithResp(
			"querySubscribeEventsByType", {
				msgEventSubscribe: t
			}, (function(t, n) {
				t || (n = {
					msgEventSubscribes: a(n)
				}), e.callback(t, n)
			}))
	}
}, function(e, t, n) {
	var s = n(0),
		r = s.notundef,
		i = n(4);

	function o(e) {
		if (s.verifyOptions(e, "type value", "event::MsgEvent"), s.verifyParamType("type", e.type, "number",
				"event::MsgEvent"), s.verifyParamType("value", e.value, "number", "event::MsgEvent"), this
			.type = e.type, this.value = e.value, this.idClient = s.guid(), r(e.custom) && (this.custom =
				"" + e.custom), this.validTime = e.validTime || 604800, s.verifyParamType("validTime", this
				.validTime, "number", "event::MsgEvent"), s.verifyParamMin("validTime", this.validTime, 60,
				"event::MsgEvent"), s.verifyParamMax("validTime", this.validTime, 604800,
			"event::MsgEvent"), r(e.broadcastType)) {
			if (s.verifyParamType("broadcastType", e.broadcastType, "number", "event::MsgEvent"), [1, 2]
				.indexOf(e.broadcastType) < 0) throw new i('参数错误"broadcastType":只能为1或2');
			this.broadcastType = e.broadcastType
		} else this.broadcastType = 2;
		r(e.sync) ? (s.verifyParamType("sync", e.sync, "boolean", "event::MsgEvent"), this.sync = e.sync) :
			this.sync = !1
	}
	o.prototype.assembleEvent = function() {
		return {
			type: this.type,
			value: this.value,
			idClient: this.idClient,
			custom: this.custom || "",
			validTime: this.validTime,
			broadcastType: this.broadcastType,
			sync: !0 === this.sync ? 1 : 0
		}
	}, e.exports = o
}, function(e, t, n) {
	var s = n(0),
		r = s.notundef;

	function i(e) {
		s.verifyOptions(e, "type", "event::MsgEventSubscribe"), s.verifyParamType("type", e.type, "number",
				"event::MsgEventSubscribe"), s.findObjIndexInArray([1, 2, 3], e.type) < 0 && s
			.verifyParamMin("type", e.type, 1e5, "event::MsgEventSubscribe"), this.type = e.type, r(e
				.subscribeTime) ? (s.verifyParamType("subscribeTime", e.subscribeTime, "number",
				"event::MsgEventSubscribe"), s.verifyParamMin("subscribeTime", e.subscribeTime, 60,
				"event::MsgEventSubscribe"), s.verifyParamMax("subscribeTime", e.subscribeTime, 2592e3,
				"event::MsgEventSubscribe"), this.subscribeTime = e.subscribeTime) : this.subscribeTime =
			2592e3, r(e.sync) ? (s.verifyParamType("sync", e.sync, "boolean", "event::MsgEventSubscribe"),
				this.sync = e.sync) : this.sync = !0
	}
	i.prototype.assembleEvent = function(e) {
		return {
			type: this.type,
			subscribeTime: this.subscribeTime,
			sync: !0 === this.sync ? 1 : 0
		}
	}, e.exports = i
}, function(e, t, n) {
	var s = n(3).fn,
		r = n(0);
	s.httpRequestProxy = function(e) {
		r.verifyOptions(e, "path", "misc::httpRequestProxy");
		var t = Object.assign({}, e);
		delete t.done, this.processCallback(e), this.sendCmd("httpProxy", {
			proxyTag: t
		}, e.callback)
	}
}, function(e, t, n) {
	var s = n(3).fn,
		r = n(1);
	s.getQChatAddress = function(e) {
		this.processCallback(e), this.sendCmd("getQChatAddress", {
			getQChatAddressTag: {
				ipType: r.ipVersion
			}
		}, e.done)
	}
}]);
